Get-VirtualServerFromAD.ps1 -
param([switch]$nameOnly)
$ds=[system.directoryservices.directorysearcher] "(&(objectCategory=serviceConnectionPoint)(cn=MS Virtual Server))"
$servers=$ds.findall()
if ($nameOnly) {
$servers | % { $_.path.split("=,")[3] }
}
else {
$servers
}
Could it be much easier?
Update: the software ate the vertical bars etc.
No comments:
Post a Comment