Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm interested in learning how to use WMIC, but I'm confused on where to begin. How does this tool compare to PowerShell? Can Powershell do everything WMIC can... and more?

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

PowerShell is a turing-complete scripting language. You can, in theory, write a program in PowerShell to do anything.

WMIC is a command-line program for interacting with WMI. By itself, it has no constructs for branching and looping, variable manipulation, or any of the nice things that a programming language has. It's just a tool, basically, for retrieving or setting values in WMI. Acting programmatically on the output or input of the tool is something that's typically handled by a batch-script that calls the tool.

You can learn more about using the WMIC tool from Microsoft or by Googling phrases like WMIC tutorial. You'll find lots of stuff.

share|improve this answer
    
Does that mean that Powershell can do everything WMIC can? For example can it execute WMI commands on remote machines with alternate creds? –  makerofthings7 Oct 21 '10 at 20:54
2  
PowerShell 1.0 has some limitations re: authentication when accessing WMI on remote computers (see technet.microsoft.com/en-us/library/ff730973.aspx) but that's cleaned-up in PowerShell 2.0. The WMI-related methods and objects in PowerShell 2.0 can allow to perform any type of WMI maniuplation that you could with any other WMI tool (WMIC, VBScript, etc). –  Evan Anderson Oct 21 '10 at 21:06
    
+1 Thanks for the additional info! –  makerofthings7 Oct 22 '10 at 2:57
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.