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
- 41 Getting started
- 25 Read before posting
- 8 Meet and greet
- 245 General
- 67 News and announcements
- 2 Swag
- 1 Roadmap updates
- 80 Resources
- 12 Knowledge Base
- 17 Webinars
- 1 Shared Script Library
- 2 Blog
- 19 Pro Tips
- 27 Got an idea?
- 3 Atera Academy
- 2 ActionAI
- 1 Copilot
- 140 Remote Monitoring and Management
- 84 Remote Monitoring
- 27 Patch Management
- 106 Professional Services Automation
- 65 Helpdesk
- 17 Billing
- 21 Reporting
- 39 Integrations & add-ons
- 21 Integrations
- 11 Add-ons
- 105 Scripting and automations
- 62 Scripts
- 30 Automations