$SiteServer = 'server'
$SiteCode = 'XXX'
$CollectionName = 'DeviceColl*'
$Collections = Get-WmiObject -ComputerName $SiteServer -Namespace "ROOT\SMS\site_$SiteCode" -Class SMS_Collection | where {$_.Name -like "$CollectionName"}
foreach ($Collection in $Collections){
$SMSClients = Get-WmiObject -ComputerName $SiteServer -Namespace "ROOT\SMS\site_$SiteCode" -Query "SELECT * FROM SMS_FullCollectionMembership WHERE CollectionID='$($Collection.CollectionID)' order by name" | select *
foreach ($SMSClient in $SMSClients){
$ClientName = $SMSClient.Name
$ClientMAC = (Get-WmiObject -Class SMS_R_SYSTEM -ComputerName $SiteServer -Namespace root\sms\site_$SiteCode | where {$_.Name -eq "$ClientName"}).MACAddresses
$SMSClient.Name + ", " + $ClientMAC + ", " + $Collection.Name | out-file -append C:\list.txt
}
}
I write some useful information and lessons learnt about SCCM, MDT, SCOM, Exchange, Lync, Windows 7/8, Windows servers, Hyper-V, Vmware
Szukaj na tym blogu
czwartek, 17 marca 2016
SCCM get collection members name and MAC address
Subskrybuj:
Komentarze do posta (Atom)
Brak komentarzy:
Prześlij komentarz