Had an interesting thread come through on Spiceworks the other day that required some detective work with WMI. In the past, when I did WMI calls with vbScript I usually had to Google it and find someone else who’d done what I wanted to do and modify their script. But with Powershell you don’t have to dig through different blogs, or try to slog through the MSDN documentation, now you can just inspect the data and do it directly. Here’s what I did.
Had someone at Spiceworks ask a question about a script they were trying to use so I asked them to post the relevant code and, lo and behold, it was my Simple Server Status script! He was having a problem with authentication because the ID he was running the script under didn’t have rights and he needed to run the script with his domain level credentials. Never got an answer as to why he couldn’t just run the script with those credentials, but modifying the script to use alternative credentials should be easy enough. Of course, it never is.