AD computer machines reported in last 30 days

Hi Team,

We are doing software audit for entire AD organization & considering last 30 days reported machine to fetch details from.

I need script which will give me list of all computer machines reported in last 30 days.

April 24th, 2015 2:42am

You may need to provide a bit more information. I don't understand what you mean by "a list of all computers reported in the last 30 days".
Free Windows Admin Tool Kit Click here and download it now
April 24th, 2015 3:15am

Hi Braham,

I used below script to fetch computers last reported in AD for 30 days.

$date = [DateTime]::Today.AddDays(-30)
Get-ADComputer -Filter  PasswordLastSet -ge $date


April 24th, 2015 3:16am

I'm still not following, you just want machines that have had their passwords set within the last 30 days?
Free Windows Admin Tool Kit Click here and download it now
April 24th, 2015 3:32am

Hi ,

Hope I'm not guessing you wrong, you mean to say AD computers which are not reported active/password reset since last 30 days ?

If yes, then try the below query in AD Saved Query-> Create a New Query -> Define Query -> Custom search -> type the below query in Advance Tab

dsquery computer -inactive 4

You will find the computers which are inactive for 30 days!!

If you find answer useful, please mark as answered. Thanks!



  • Edited by Vernekar 22 hours 50 minutes ago
April 24th, 2015 4:17am

Hi,

AD has all computer objects active & inactive. So i though better way to find out all active machines from AD is to fetch computer last password reset timestamp.

So thinking to fetch all machine accounts with last password in 45 days. I hope this is the better approach. please suggest if any other approach i can follow to get all active machine list.

Free Windows Admin Tool Kit Click here and download it now
April 24th, 2015 5:47am

Hope you need this

$days = (Get-Date).AddDays(-45) Get-ADComputer -Filter {(pwdLastset -lt $days) -and (Enabled -eq $true) } |

Select Name , ObjectClass


April 24th, 2015 7:59am

Hi ,

Hope I'm not guessing you wrong, you mean to say AD computers which are not reported active/password reset since last 30 days ?

If yes, then try the below query in AD Saved Query-> Create a New Query -> Define Query -> Custom search -> type the below query in Advance Tab

dsquery computer -inactive 4

You will find the computers which are inactive for 30 days!!

If you find answer useful, please mark as answered. Thanks!



  • Edited by Vernekar Friday, April 24, 2015 8:18 AM
Free Windows Admin Tool Kit Click here and download it now
April 24th, 2015 8:17am

Hi ,

Hope I'm not guessing you wrong, you mean to say AD computers which are not reported active/password reset since last 30 days ?

If yes, then try the below query in AD Saved Query-> Create a New Query -> Define Query -> Custom search -> type the below query in Advance Tab

dsquery computer -inactive 4

You will find the computers which are inactive for 30 days!!

If you find answer useful, please mark as answered. Thanks!



  • Edited by Vernekar Friday, April 24, 2015 8:18 AM
April 24th, 2015 8:17am

By default all computers joined to the domain will have their passwords reset every 30 days automatically. There should be no computers with a password older than 30 days, unless they are turned off or disconnected from the domain. Hopefully, that is what you intend, to find computers that are no longer
Free Windows Admin Tool Kit Click here and download it now
April 24th, 2015 12:46pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics