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
- 43 Getting started
- 26 Read before posting
- 9 Meet and greet
- 273 General
- 74 News and announcements
- 2 Swag
- 3 Roadmap updates
- 1 Product Survey
- 90 Resources
- 15 Knowledge Base
- 18 Webinars
- 1 Shared Script Library
- 2 Blog
- 22 Pro Tips
- 30 Got an idea?
- 3 Atera Academy
- 3 ActionAI
- 1 Copilot
- 146 Remote Monitoring and Management
- 85 Remote Monitoring
- 29 Patch Management
- 113 Professional Services Automation
- 67 Helpdesk
- 17 Billing
- 24 Reporting
- 43 Integrations & add-ons
- 23 Integrations
- 11 Add-ons
- 109 Scripting and automations
- 62 Scripts
- 32 Automations