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
- 61 Getting started
- 27 Read before posting
- 9 Meet and greet
- 330 General
- 77 News and announcements
- 2 Swag
- 6 Roadmap updates
- 1 Product Survey
- 101 Resources
- 1 Onboarding
- 17 Knowledge Base
- 23 Webinars
- 1 Shared Script Library
- 3 Blog
- 24 Pro Tips
- 30 Got an idea?
- 3 Atera Academy
- 8 ActionAI
- 5 Copilot
- 223 Remote Monitoring and Management
- 91 Remote Monitoring
- 29 Patch Management
- 120 Professional Services Automation
- 72 Helpdesk
- 18 Billing
- 24 Reporting
- 44 Integrations & add-ons
- 23 Integrations
- 12 Add-ons
- 115 Scripting and automations
- 64 Scripts
- 36 Automations