我正在寻找脚本来搜索AD中的Window 7计算机,因为60天后没有登录。排除隔离区OU,我正在使用此编码,但它不起作用:
geoViewport.bounds([-122.67, 45.52], 12.25, [512, 512])
答案 0 :(得分:0)
您只是在get和select之间缺少管道绑定,删除注释并替换为|像这样:
Get-ADComputer -Filter { LastLogonTimeStamp -lt $time -and OperatingSystem -like 'Windows 7 *'} -Properties LastLogonTimeStamp | Where-Object { $_.DistinguishedName -notlike '*,OU=COMPUTERS,OU=Quarantine,DC=ad,DC=int,DC=com,*' } | Select-Object Name, @{ Name = "Stamp"; Expression = { [DateTime]::FromFileTime($_.lastLogonTimestamp) } } | Export-Csv OLD_Computer.csv -NoTypeInformation
此命令在我的环境中正常运行。