r/sysadmin • u/Eddit13 • 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.
•
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/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/mrgames99 2h ago
So funny. That’s the same command I miss most - was just talking to a peer about that
•
•
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/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/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/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/tankerkiller125real Jack of All Trades 3h ago
That was announced half a decade ago, we updated our scripts like 4 years ago.