With the death of WMIC
Hi All,
With M$ deprecating WMIC, instead of fighting it, I've decided to go with it and use powershell alternatives to do something I've automated for years:
WMIC CSPRODUCT get name,vendor,identifyingnumber
We don't allow unsigned powershell scripts and most of the solutions I've found are multi line scripts. Is there a single line powershell command that I can run from a batch file to get this basic information? Since I'm running the powershell command from a batch file command, the total command has to be under ?255 characters? or something like that.
Thanks,
Jeff
Comments
-
Wow, I figured someone would slap out a .PS1 script for me so quick that I'd get dizzy, but I guess people are just enabling WMIC on Windows 11's newest builds. I don't blame people sticking with WMIC because PowerShell is a giant time-wasting beast. Here is the command I figured out that gave me the same basic output as my WNIC csproduct get name,vendor,identifyingnumber command that I've used for years:
PowerShell -Command "Get-ComputerInfo -Property CSDNSHOSTNAME,BiosManufacturer,CsModel,BiosSeralNumber
As you may note, I'm running it from a batch file due to our organization blocking unsigned scripts. The output looks like this:
I hope this helps.
Jeff
0
Topics
- All Topics
- 60 Getting started
- 27 Read before posting
- 9 Meet and greet
- 316 General
- 73 News and announcements
- 2 Swag
- 5 Roadmap updates
- 1 Product Survey
- 94 Resources
- 17 Knowledge Base
- 18 Webinars
- 1 Shared Script Library
- 3 Blog
- 23 Pro Tips
- 30 Got an idea?
- 3 Atera Academy
- 8 ActionAI
- 5 Copilot
- 219 Remote Monitoring and Management
- 89 Remote Monitoring
- 29 Patch Management
- 118 Professional Services Automation
- 70 Helpdesk
- 18 Billing
- 24 Reporting
- 43 Integrations & add-ons
- 23 Integrations
- 11 Add-ons
- 113 Scripting and automations
- 62 Scripts
- 36 Automations