Posts Tagged ‘dsrm’

Query computer objects which have been inactive for 8 weeks in a specific OU

dsquery computer “OU=Computers,OU=OUNAME,DC=domain,DC=local” -inactive 8 

Query computer objects which have been inactive for 8 weeks in a specific OU and name starts with PCNAME

dsquery computer “OU=Computers,OU=OUNAME,DC=domain,DC=local” -inactive 8 -name PCNAME* 

Open the Command Prompt now as Administrator

Query THEN DELETE computer objects which have been inactive for 8 weeks in a specific OU and name starts with PCNAME

dsquery computer “OU=Computers,OU=OUNAME,DC=domain,DC=local” -inactive 8 -name PCNAME* | dsrm -noprompt

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)