Created
June 26, 2013 16:39
-
-
Save lazywinadmin/5869055 to your computer and use it in GitHub Desktop.
Get-SCCMComputer
This file contains 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
if($computerName) { | |
return Get-WMIObject -ComputerName $siteProvider -Namespace "root\sms\site_$siteCode" -class "SMS_R_System" -filter "Name LIKE `"%$ComputerName%`"" | |
} elseif($resourceId) { | |
return Get-WMIObject -ComputerName $siteProvider -Namespace "root\sms\site_$siteCode" -Class "SMS_R_System" -filter "ResourceID=$resourceId" | |
} else { | |
return Get-WMIObject -ComputerName $siteProvider -Namespace "root\sms\site_$siteCode" -Class "SMS_R_System" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment