September 25th, 2013

PowerTip: Make Multiple WMI Queries to Remote Machine

Doctor Scripto
Scripter

Summary: Learn how to make multiple WMI queries to a remote machine more efficient.

Hey, Scripting Guy! Question How can I make running multiple WMI queries against a remote machine more efficient?

Hey, Scripting Guy! Answer Create a CIM session with New-CimSession, and use that in your calls instead of a computer name:

$sess = New-CimSession –Computername server02

Get-CimInstance –ClassName Win32_OperatingSystem –CimSession $sess

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.

Feedback