Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Get all AD computer with Win7 logged the last 6 months :
- Get-ADComputer -SearchBase "ou=myOU,dc=ad,dc=myentreprise,dc=fr" -Filter {OperatingSystem -Like '*win*7*' } -Properties OperatingSystem, LastLogonDate | ? { $_.LastLogonDate -GT (Get-Date).AddDays(-180) } | select -Property Name, Lastlogondate, OperatingSystem | Export-Csv -Path $env:homepath"\win7Machines6Mon.csv"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement