With the death of WMIC

jeff
jeff Member Posts: 15

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

  • jeff
    jeff Member Posts: 15

    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