Skip to content

Instantly share code, notes, and snippets.

@lazywinadmin
Created June 26, 2013 16:39
Show Gist options
  • Save lazywinadmin/5869055 to your computer and use it in GitHub Desktop.
Save lazywinadmin/5869055 to your computer and use it in GitHub Desktop.
Get-SCCMComputer
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