Intune Initial Scripts Backup
This commit is contained in:
20
dump/temp/collection-membership.ps1
Normal file
20
dump/temp/collection-membership.ps1
Normal file
@@ -0,0 +1,20 @@
|
||||
$Dev = "w2012a","w2012b"
|
||||
$Temp = @()
|
||||
$Dev | % { $S = $_
|
||||
$W = (Get-WmiObject -ComputerName pncrasccm001 -Namespace root\SMS\site_ccx -Query "SELECT SMS_Collection.* FROM SMS_FullCollectionMembership, SMS_Collection where name = '$S' and SMS_FullCollectionMembership.CollectionID = SMS_Collection.CollectionID").name
|
||||
|
||||
$W | % {
|
||||
$Obj = New-Object -TypeName PSObject
|
||||
$Obj | Add-Member -MemberType NoteProperty -Name Server -Value $S
|
||||
$Obj | Add-Member -MemberType NoteProperty -Name Collection -Value $_
|
||||
$Obj
|
||||
$Temp += $Obj
|
||||
}
|
||||
|
||||
}#end%
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#$Collections | select name
|
||||
Reference in New Issue
Block a user