#DSQuery dsquery user -name "*" -limit 0 | dsget user -samid -hmdir -hmdrv -profile >c:\temp\usersV2.txt #PowerShell # More flexibility # Includes the state of the computer account (Enable or…
List Computer Object in an Active Directory OU using PowerShell
How to get a list of computer objects in an active directory OU ( tested against Windows 2016 Active Directory ) A quick PowerShell script using Get-ADComputer command, a wild…
Get a list of inactive computers which have not logged on to the domain in the last 12 weeks
# Inactive computers ( this will include systems not regularly used) # Launch command prompt as administrator and run the following commands Dsquery computer -inactive 12 -limit 500 # Lists…
Disable inactive computers in AD
I would be tempted to run it manually in two parts.. that sounds a little cautious I know.. From your DC you can run CMD ( as admin ) dsquery…