Showing posts with label net user. Show all posts
Showing posts with label net user. Show all posts

3/25/2012

query computers in Active directory

##Make Sure to the following commands on AD and Run as administrator
##How to query inactive computers in AD And increase the View limit
open CMD then
dsquery computer -inactive 8 -limit 400"

### How to disable the inactive computers
OPen CMD then
"dsquery computer -inactive 8 -limit 400| dsmod computer -disabled yes"
###If you need to target a specific OU, simply place DN of the OU after the computer:
"dsquery computer "OU=Build,DC=Domain,DC=com" -inactive 8 | dsmod computer -disabled yes"
dsmove "cn=computer
**************************

To find out detailed information about a user account: net user username 
C:\>net user etbain

********************
###To find out where (which OU) a user account resides in ADS:
dsquery user -samid username


*******************************
##to get the list of users who hasnt been active for the last 16 week
dsquery user -inactive 16 | dsget user -dn
****************************************************
## how to know on whcih DC the users has been authenticated
From Command prompt
ECHO %LOGONSERVER%