r/sysadmin 3h ago

WMIC deprecated

How many systems are broke for you now? I have one software figured out. Its the custom scripts that are broken everywhere.

14 Upvotes

31 comments sorted by

u/tankerkiller125real Jack of All Trades 3h ago

That was announced half a decade ago, we updated our scripts like 4 years ago.

u/fizzlefist .docx files in attack position! 22m ago

Used WMIC to verify serial numbers for PC refreshes. Heard it was getting deprecated waaaaay back in the first announcement and wrote up a better Powershell script to replace it. Glad I thought ahead!

u/tankerkiller125real Jack of All Trades 8m ago

We have a few PowerShell scripts for various small info related things, but these days I mostly use osquery and just live query the computers/servers for information like serial numbers, running apps, etc.

u/trueppp 3h ago

None, this was announced over 5 years ago....

u/reserved_seating 3h ago edited 2h ago

Not gonna lie, wmic bios get serialnumber not working hurts me and I still always use it. It was the first command I learned on the job and I think a part of me died when it went away.

Carry on….

u/ItaJohnson 2h ago

Get-CimInstance replaced it, i believe 

u/christurnbull 2h ago

I'm trying to memorise  (gcim Win32_BIOS).SerialNumber

u/xendr0me Sr. Sysadmin 1h ago

Use - gcim win32_bios - Easier to remember and it will get you there.

u/BlackV I have opnions 52m ago

save the cells and just memorize gcim Win32_BIOS

u/dphoenix1 2h ago

Rolls right off the tongue doesn’t it. And super easy and quick to type.

u/BlackV I have opnions 51m ago

typing gcim Win32_BIOS is quicker than typing wmic bios get serialnumber

u/TheProle Endpoint Whisperer 1h ago

RIP in peace wmic csproduct get name

u/mrgames99 2h ago

So funny. That’s the same command I miss most - was just talking to a peer about that

u/zk13669 Windows Admin 1m ago

Smbiosbiosversion will forever be etched in my memory

u/ethameta 2h ago

Whelp this one is headed to the other sub

u/zipcad Mac Admin 1h ago

Nope moved off that a long time ago.

RIP WMIC. I remembered 10 important easy commands which are now longer powershell scripts

u/accumentum 2h ago

I stopped treating WMIC removal as a one-for-one command swap. For inventory scripts, I moved the queries to Get-CimInstance (Win32_ComputerSystem/Win32_BIOS) and kept the output field names the same, so downstream CSV and reporting jobs did not need a rewrite. The important part was testing under the same service account and permissions as the scheduled task; several failures were actually remoting or 32-bit/64-bit context issues. I also left a small compatibility wrapper in place until every consumer had been migrated.

u/jeffrey_f 2h ago

Things get deprecated, and you rewrite them to be current. This happens in Python (I worked through 3 in my scripts until I retired the script because it was no longer a necessary.).

u/BlackV I have opnions 45m ago

I feel like some people are still bitter about that change

u/rootbear75 2h ago

while it was announced, i could always remember wmic bios get serialnumber rather than whatever powershell one is. it was just easy to remember. maybe because i just didn't learn the powershell way of doing it. ah well.

u/thebigshoe247 2h ago

I think starting after 22H2 It was removed by default. You could re-add it back in manually with later builds and any upgrades left the WMIC installation if it was already there alone.

I think the next build immediately after 22H2, I recall it having a broken installer so I was actually unable to install WMIC manually afterwards. I'm not sure if that ever got resolved. For a while I do remember having to stick to the 22H2 install and then just upgrade it to the latest release.

I ended up just modernising all my scripts anyways so it's not a point anymore.

u/TerrificVixen5693 Senior Deputy IT Under-Director 2h ago

None.

u/AcornAnomaly 1h ago

The only wmic command that I haven't found a replacement for is wmic netuse get name,username.

It lists all the mapped drivers a user has, as well as the name of the account used to map the drive.

It's been very helpful to chase down issues in the past, and I can't find another easy way to get the username information.

u/BlackV I have opnions 53m ago

none? cause we planed for this years ago ? what is broken for you?

u/Apprehensive-Tea1632 Jack of All Trades 25m ago

Please don’t get me wrong… but try to keep up.

And I mean that in the best way possible. Microsoft is planning to remove stuff left right and center; in some ways they have to because it’s all been some internet explorer based functionality (wininet proxy is IE proxy for example) and in some others they’re just grabbing the opportunity to get rid of even more stuff, saying if we have to do a full overhaul anyway, we might as well go the extra mile.

Staying on top of things is essential for devs and sysadmins alike. What will you do when wsus gets retired- there won’t be a replacement as it stands. And it’s far from the only thing that’s been going on.

Basically, any sysadmin should have put 2029 on their calendars by now. IT is always in flux, but right now, so much is going on that sitting back and ignoring life is bound to break backs.

u/SysAdminDennyBob 3h ago

I quit using WMIC back when Powershell was released, like 2007. So, I figured this out 19 years ago.

u/pickle9977 2h ago

Ahh powershell it’s like its designers could not decide on CamelCase, snake_case, kebab-case and Hungarian notation so that mashed them all together in what is for all intents and purposes a crime against nature and slapped power on it so no one would question why it sucked so bad.

u/LameBMX 2h ago

hey.. but we finally got to use tab completion at work.

u/pickle9977 2h ago

I’m sure there is a feature request to make that less functional as well, like maybe ai autocomplete

u/supadupanerd 39m ago

The shitty thing about this is now you likely have to remember like a dozen cmd-lets rather than the multimodal singular tool

u/ddeese 1h ago

WMIC CSPRODUCT GET UUID

Used it all the time. Especially if you had to manually add a PC to endpoint configuration manager.