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.
Technology Tips and News
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.
Hi Braham,
I used below script to fetch computers last reported in AD for 30 days.
$date = [DateTime]::Today.AddDays(-30)
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!
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.
Hope you need this
$days = (Get-Date).AddDays(-45) Get-ADComputer -Filter {(pwdLastset -lt $days) -and (Enabled -eq $true) } |
Select Name , ObjectClass
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!
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!