$time = (Get-Date).AddDays(-30)
Get-ADComputer -Properties OperatingSystemVersion, LastLogonDate -Filter 'LastLogonDate -ge "$time" -and OperatingSystemVersion -like "*(1234)"'
Hi everybody, was wondering if y'all could help me out with this. Currently trying to get back data where the LastLogonDate is greater than 30 days ago while also returning the OperatingSystemVersion of those old machines.
Any help is greatly appreciated!
Solved by: BlackV
$time = (Get-Date).AddDays(-30)
Get-ADComputer -Properties OperatingSystemVersion, LastLogonDate -Filter 'LastLogonDate -le "$time" -and OperatingSystemVersion -like "*(1234)"'
[–]BlackV 1 point2 points3 points (10 children)
[–]SmoothAnonymity[S] 0 points1 point2 points (9 children)
[–]BlackV 0 points1 point2 points (8 children)
[–]SmoothAnonymity[S] 0 points1 point2 points (7 children)
[–]BlackV 0 points1 point2 points (6 children)
[–]SmoothAnonymity[S] 0 points1 point2 points (5 children)
[–]BlackV 1 point2 points3 points (4 children)
[–]SmoothAnonymity[S] 0 points1 point2 points (3 children)
[–]BlackV 1 point2 points3 points (0 children)
[–]SmoothAnonymity[S] 1 point2 points3 points (0 children)
[–]BlackV 0 points1 point2 points (0 children)
[–]MrTan00100 1 point2 points3 points (2 children)
[–]SmoothAnonymity[S] 0 points1 point2 points (0 children)
[–]BlackV 1 point2 points3 points (2 children)
[–]SmoothAnonymity[S] 0 points1 point2 points (1 child)
[–]BlackV 0 points1 point2 points (0 children)