Sign in to follow this  
Followers 0
sstivers

Remove Machine Accounts from old Domain

7 posts in this topic

I have been given the task of cleaning up an old domain as we move to active directory.

I need to be able to remove machine accounts from the old domain as the machines are moved to the new AD.

Any good examples?

I'm sure the solution will be to use objget().

Is there a good reference for WINNT objects?

I have found several examples of adding users but can not decipher all the things that can be done. I would like to be more self sufficient in this area.

Thanks

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

From the command prompt, logged in at a server on the domain in question:

net computer \\computername /del

Edited by lod3n

[font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]

Share this post


Link to post
Share on other sites

Or you can use NETDOM to join and remove computers from the domain.


AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line

Share this post


Link to post
Share on other sites

Unfortunately I do not have access to log into the domain controller directly.

From the command prompt, logged in at a server on the domain in question:

net computer \\computername /del

Share this post


Link to post
Share on other sites

Netdom is getting the machine disconnected from the domain but it is not removing the account.

Am I missing something about Netdom?

Or you can use NETDOM to join and remove computers from the domain.

Share this post


Link to post
Share on other sites

Unfortunately I do not have access to log into the domain controller directly.

Get psexec from sysinternals, and then:

psexec \\servername net computer \\computername /DEL

It's still important to be logged into the domain in question on your own computer when you do this, otherwise, it will remove it remove it from your own domain.


[font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]

Share this post


Link to post
Share on other sites

Are you looking to clean up stale PC accounts? If you are I've got an untested script (too chicken to run it in production but the lab looks ok) that I wouldn't mind seeing if it works.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0