(Get-ADComputer -Filter {OperatingSystem -Like "Windows Server*"} -Property Name,OperatingSystem,OperatingSystemServicePack) | ForEach-Object {
try{
$DNS = Resolve-DnsName -Name $_.Name -ErrorAction Stop
} Catch{
}
write-host ('"' + $_.Name + '","' + $_.OperatingSystem + '","' + $_.OperatingSystemServicePack + '","' + $DNS.IPAddress + '"')
};
try{
$DNS = Resolve-DnsName -Name $_.Name -ErrorAction Stop
} Catch{
}
write-host ('"' + $_.Name + '","' + $_.OperatingSystem + '","' + $_.OperatingSystemServicePack + '","' + $DNS.IPAddress + '"')
};
沒有留言:
張貼留言