Last active
December 19, 2015 00:49
-
-
Save lazywinadmin/5871509 to your computer and use it in GitHub Desktop.
Get-WmiObject with Filtering
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Let's measure our command on a big environment (+6000 computers) with some filtering | |
# Note that I replaced some values, you need to specify the SiteProvider, SiteCode and | |
# ResourceID. | |
Measure-Command {Get-WMIObject` | |
-ComputerName <SiteProvider> ` | |
-Namespace "root\sms\site_<SITECODE>" ` | |
-Query "Select * From SMS_R_System WHERE ResourceID='<ResourceID>'"} | |
Days : 0 | |
Hours : 0 | |
Minutes : 0 | |
Seconds : 0 | |
Milliseconds : 202 | |
Ticks : 2026858 | |
TotalDays : 2.34590046296296E-06 | |
TotalHours : 5.63016111111111E-05 | |
TotalMinutes : 0.00337809666666667 | |
TotalSeconds : 0.2026858 | |
TotalMilliseconds : 202.6858 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment