これは可能ですか?System.DirectoryServices.PropertyValueCollection
からに変換する必要がありString
ます。
すなわち
$ou = [ADSI]"LDAP://OU=Domain Controllers,DC=domain,DC=local"
foreach ($child in $ou.psbase.Children) {
if ($child.ObjectCategory -like '*computer*') {
Write-Host $child.Name
if (Test-Connection -quiet $child.Name) {
Test-Connection $child.name
Invoke-GPUpdate $child.name
}else{Write-Host "$child.Name is offline"}
}
}