Questions

Not able to delete stale computer

+
0 Votes
Locked

Not able to delete stale computer

rgnambiar
Hi,

I am not able to delete the stale computer from my domain by using the below dsquery command.

dsquery computer inactive 468 | dsrm noprompt

Please help me out in deleting the stale computer
  • +
    1 Votes
    glen.harris

    Hi,
    I'm not currently near a domain to try this but think the command should be:
    dsquery computer -inactive 468 | dsrm -noprompt
    where 468 represents 468 weeks of inactivity.

    +
    0 Votes
    rgnambiar

    Thanks for the reply. I did try that command, but i am getting an error stating that the dsrm command is not recognised. Yes i am looking out to delete the stale computers for 9 years.

    +
    0 Votes
    glen.harris

    (remote server administration tools) Go to microsoft dot com and type 7887 in the search box (Win 7 Version). Alternatively, remote desktop onto one of the domain controllers and run the command from there.

    +
    0 Votes
    rgnambiar

    i am using windows 2008 r2 enterprise, i think you are suggesting for win7

    +
    0 Votes
    glen.harris

    Dsrm is a command-line tool that is built into Windows Server 2008. It is available if you have the Active Directory Domain Services (AD DS) or Active Directory Lightweight Directory Services (AD LDS) server role installed. To use dsrm, you must run the dsrm command from an elevated command prompt. To open an elevated command prompt, click Start, right-click Command Prompt, and then click Run as administrator.

    Not from technet:
    To add the server role go to Server Manager, click roles in the left pane, add roles in the right pane, click next then install.

    I would have thought that you'd already have the AD role installed on the server if it is a DC. AD can be dangerous if you don't know what you are doing. Unless this is a test domain of some sort that you are experimenting with be very careful.

  • +
    1 Votes
    glen.harris

    Hi,
    I'm not currently near a domain to try this but think the command should be:
    dsquery computer -inactive 468 | dsrm -noprompt
    where 468 represents 468 weeks of inactivity.

    +
    0 Votes
    rgnambiar

    Thanks for the reply. I did try that command, but i am getting an error stating that the dsrm command is not recognised. Yes i am looking out to delete the stale computers for 9 years.

    +
    0 Votes
    glen.harris

    (remote server administration tools) Go to microsoft dot com and type 7887 in the search box (Win 7 Version). Alternatively, remote desktop onto one of the domain controllers and run the command from there.

    +
    0 Votes
    rgnambiar

    i am using windows 2008 r2 enterprise, i think you are suggesting for win7

    +
    0 Votes
    glen.harris

    Dsrm is a command-line tool that is built into Windows Server 2008. It is available if you have the Active Directory Domain Services (AD DS) or Active Directory Lightweight Directory Services (AD LDS) server role installed. To use dsrm, you must run the dsrm command from an elevated command prompt. To open an elevated command prompt, click Start, right-click Command Prompt, and then click Run as administrator.

    Not from technet:
    To add the server role go to Server Manager, click roles in the left pane, add roles in the right pane, click next then install.

    I would have thought that you'd already have the AD role installed on the server if it is a DC. AD can be dangerous if you don't know what you are doing. Unless this is a test domain of some sort that you are experimenting with be very careful.