WMIC : Invalid Global Switch - The How and Why Cookbook
WMIC says "Invalid Global Switch" Why does it say that when you use the /NODE switch? It's because WMIC really wants the full IP address of the remote computer, not the name. Here's an example of it: This is the right way to do it, to prevent "Invalid Global Switch" The WMIC Cookbook In these examples, we will write all output to a file called a.out. First one will be written, others will be appended. # --------- CUT HERE ----------------------- # A powershell script by Uncle Joe # To append to the file, use /APPEND instead of /OUTPUT $username="talladega\lets_go_brandon" $password="Nascar22" # Get Computer Name wmic /NODE:192.168.0.143 /OUTPUT:a.out /USER:${username} /PASSWORD:${password} computersystem get model,manufacturer,name,username # Disk Check wmic /NODE:192.168.0.143 /APPEND:a.out /USER:${username} /PASSWORD:${password} logicaldisk list full # CPU Check: wmic /NODE:192.168.0.143 /APPEND:a.out /USER:${username} /PASSWORD...