Results 1 to 7 of 7

Thread: Removing old computer accounts

  1. #1
    Sohail Guest

    Removing old computer accounts

    I read somewhere, I forgot, there is command line tool to list all computer
    accounts & also can delete computer accounts not active morethan specified
    days with additional arguments with that command. Any help

  2. #2
    Pegasus \(MVP\) Guest

    Re: Removing old computer accounts


    "Sohail" <Sohail@discussions.microsoft.com> wrote in message
    news:CA651C7A-66B9-4B15-9D22-44DF1911E52B@microsoft.com...
    >I read somewhere, I forgot, there is command line tool to list all computer
    > accounts & also can delete computer accounts not active morethan specified
    > days with additional arguments with that command. Any help


    If you have a small number of users then the command

    net user UserName [/domain]

    would be adequate. If you have a large number then you
    will probably find a suitable scripting solution here:

    http://www.rlmueller.net/UserAttributes.htm

    If you need to post again, remember to state if you operate
    in a domain/AD environment.



  3. #3
    Richard Mueller [MVP] Guest

    Re: Removing old computer accounts


    "Sohail" <Sohail@discussions.microsoft.com> wrote in message
    news:CA651C7A-66B9-4B15-9D22-44DF1911E52B@microsoft.com...
    >I read somewhere, I forgot, there is command line tool to list all computer
    > accounts & also can delete computer accounts not active morethan specified
    > days with additional arguments with that command. Any help


    You may be referring to Joe Richards' free oldcmp utility:

    http://www.joeware.net/freetools/tools/oldcmp/index.htm

    --
    Richard Mueller
    Microsoft MVP Scripting and ADSI
    Hilltop Lab - http://www.rlmueller.net
    --



  4. #4
    Sohail Guest

    Re: Removing old computer accounts

    m asking for computer account i remember i read about dnsquery or dns command
    (.exe file) with some arguments

    "Pegasus (MVP)" wrote:

    >
    > "Sohail" <Sohail@discussions.microsoft.com> wrote in message
    > news:CA651C7A-66B9-4B15-9D22-44DF1911E52B@microsoft.com...
    > >I read somewhere, I forgot, there is command line tool to list all computer
    > > accounts & also can delete computer accounts not active morethan specified
    > > days with additional arguments with that command. Any help

    >
    > If you have a small number of users then the command
    >
    > net user UserName [/domain]
    >
    > would be adequate. If you have a large number then you
    > will probably find a suitable scripting solution here:
    >
    > http://www.rlmueller.net/UserAttributes.htm
    >
    > If you need to post again, remember to state if you operate
    > in a domain/AD environment.
    >
    >
    >


  5. #5
    Mohamed Garrana Guest

    Re: Removing old computer accounts

    hey sohail
    dsquery computer -limit 0 -inactive 10 >C:\TenWeeks.txt

    this command queries computer accounts that are inactive for 10 weeks

    what i do for deletion procedure is the following

    1. Querying for computer accounts with less than 10 weeks logon attempts and
    exporting it to a txt file
    dsquery computer -limit 0 -inactive 10 >C:\TenWeeks.txt

    2. copy and paste all the output data in an excel sheet such that the sheets
    looks like the following
    Dsmove “ Date exported “ -newparent New distination Distinguised name


    3. concatenate the 2 columns containing “ with the date exported into a
    single column to have the following view
    Dsmove “data exported” -newparent New DN for destination


    4. Copy all the data and paste it into a Microsoft word document file, it
    will be exported as a table
    5. Choose the convert to text option and separate the columns with a space
    6. Copy all the data and paste it into a txt file , then convert the
    extension to a .bat file
    7. Run it and enjoy


    "Sohail" <Sohail@discussions.microsoft.com> wrote in message
    news:CA651C7A-66B9-4B15-9D22-44DF1911E52B@microsoft.com...
    >I read somewhere, I forgot, there is command line tool to list all computer
    > accounts & also can delete computer accounts not active morethan specified
    > days with additional arguments with that command. Any help



  6. #6
    Dejan Dakic Guest

    Re: Removing old computer accounts

    You need program "Active Directory Janitor"


    On Tue, 15 Jan 2008 10:59:00 -0800, Sohail wrote:

    > I read somewhere, I forgot, there is command line tool to list all computer
    > accounts & also can delete computer accounts not active morethan specified
    > days with additional arguments with that command. Any help


  7. #7
    Join Date
    Oct 2008
    Posts
    1
    This command will find all computers with a stale password 90 old or older and remove them from active directory.

    dsquery computer -uco -stalepwd 90 -limit 0 | dsrm -uci -noprompt

    The dsrm command is able to us Unicode input/output. The dsquery command does not state that it can so I decided to try it and it worked great. You need to use the -noprompt so it will remove the computer then move on to the next one without any input.

    -uco = unicode formatted output
    -uci = unicode formatted input

    Rick

Similar Threads

  1. How to find old computer accounts on Windows Server
    By Russyan in forum Active Directory
    Replies: 3
    Last Post: 14-11-2014, 04:52 PM
  2. Replies: 3
    Last Post: 22-08-2011, 12:40 PM
  3. AD fails to authenticate some computer accounts
    By Tom in forum Active Directory
    Replies: 4
    Last Post: 21-09-2010, 04:07 PM
  4. Export/import of computer accounts
    By Wazza10Roo in forum Active Directory
    Replies: 8
    Last Post: 29-04-2010, 03:31 AM
  5. Replies: 2
    Last Post: 22-07-2009, 11:55 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,653,622.38786 seconds with 17 queries