Remotely deleting computers from Active Directory
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Remotely deleting computers from Active Directory
I've been banging my head against a wall and need some help here.I need a batch that can run on a client to remotely remove computer names from Active Directory on the server, it also needs to prompt to ask which computer you want to delete.I can achieve this with a vbs that has to be run locally on the server, but I really need to be able to do this on client machines.Any help is much appreciated
Remotely deleting computers from Active Directory
Sorry nobody got back to you sooner. You could use the DS* commands from a prompt. DSQUERY computer will return all computer accounts. You can also specify an OU to search in. Normally you can pipe output from one DS command into another, but I couldn't get that to work for the DSRM command which will remove AD Objects. But you can do something like this:C:>for /f %c in ('dsquery computer "ou=demo,ou=servers,dc=jdhitsolutions,dc=local"') do @dsrm %cYou will be prompted for each deletion:Are you sure you wish to delete CN=DemoServer01,OU=Demo,OU=Servers,DC=jdhitsolutions,DC=local (Y/N)? Does this help?
Remotely deleting computers from Active Directory
Hello!
The DS* suite are pretty powerful commands indeed. But in this case I'll use netdom remove /? from Support tools / Reskit for removal om computer acounts.
The DS* suite are pretty powerful commands indeed. But in this case I'll use netdom remove /? from Support tools / Reskit for removal om computer acounts.