Many IT administrators may encounter scenarios in which the Active Directory on the client domain controller has more than 800 computer objects in the Computers container (the actual number may be around 400), some of which were previously joined to the domain, and then re-joined to the domain due to re-doing the system. But now the computer name is different from the previous one, but the previous computer name is still in computers. Now there are so many computers inside, there is no way to determine which computers are useless, so that they can be deleted.
The answer is the Active Directory command, and the specific command is
Dsquery computer–inactive 15–limit 1000
Identify computers that are inactive for 15 weeks (for example).
650) this.width=650; "title=" clip_image002 "style=" border-top:0px; border-right:0px; Background-image:none; border-bottom:0px; padding-top:0px; padding-left:0px; border-left:0px; padding-right:0px "border=" 0 "alt=" clip_image002 "src=" http://s3.51cto.com/wyfs02/M01/5A/DB/ Wkiol1t-q7eqzhv-aacr9vakucm635.jpg "" 558 "height=" 143 "/>
Parameter interpretation
650) this.width=650; "title=" clip_image004 "style=" border-top:0px; border-right:0px; Background-image:none; border-bottom:0px; padding-top:0px; padding-left:0px; border-left:0px; padding-right:0px "border=" 0 "alt=" clip_image004 "src=" http://s3.51cto.com/wyfs02/M02/5A/DB/ Wkiol1t-q7zilvwqaaiysnytmay982.jpg "" 558 "height=" 367 "/>
dsquery computer-inactive 15 | Dsrm–subtree-noprompt-c
Isolate the inactive computer for 15 weeks and remove it.
650) this.width=650; "title=" clip_image005 "style=" border-top:0px; border-right:0px; Background-image:none; border-bottom:0px; padding-top:0px; padding-left:0px; border-left:0px; padding-right:0px "border=" 0 "alt=" clip_image005 "src=" http://s3.51cto.com/wyfs02/M00/5A/DB/ Wkiol1t-q72dsbo4aaflkfswd3c609.jpg "" 681 "height=" 255 "/>
Problem solving. Similarly, if you want to count long-term inactive Exchange mailbox users, Lync Users can also be resolved with similar commands.
Long-term inactive computers in the location domain