AD Error when removing computer accounts via script. 
Author Message
 AD Error when removing computer accounts via script.

Hello,

When running a very basic script to remove computer accounts from AD, I am
getting the following error.
"Active Directory: Unspecified error" The script is pulled right from a
book, just using it to test doing this.
Does anyone know what could be wrong? Here is the script.

Dim Container
Dim ContainerName
Dim ComputerToRemove
ContainerName = "Computers"
Set Container = GetObject("WinNT://" & ContainerName)
ComputerToRemove = "06047PCCO"
Call Container.Delete("Computer", ComputerToRemove)

Thanks!

--
Adrian Mink
Security Engineer, Data Security
MCSE, CCNA

Work: (602) 371-5302
Pager: (602) 259-2639



Tue, 19 Oct 2004 03:08:19 GMT  
 AD Error when removing computer accounts via script.

Quote:

> Hello,

> When running a very basic script to remove computer accounts from AD, I am
> getting the following error.
> "Active Directory: Unspecified error" The script is pulled right from a
> book, just using it to test doing this.
> Does anyone know what could be wrong? Here is the script.

> Dim Container
> Dim ContainerName
> Dim ComputerToRemove
> ContainerName = "Computers"
> Set Container = GetObject("WinNT://" & ContainerName)
> ComputerToRemove = "06047PCCO"
> Call Container.Delete("Computer", ComputerToRemove)

> Thanks!

Is your domain named "Computers" ???

ContainerName = "MyDomainName"
or
ContainerName = "MyDomainController"

--
Michael Harris
Microsoft.MVP.Scripting
Seattle WA US
--



Tue, 19 Oct 2004 03:20:23 GMT  
 AD Error when removing computer accounts via script.
Stupid error on my part, but I just didn't see it. Thanks!

Adrian



Quote:

> Hello,

> When running a very basic script to remove computer accounts from AD, I am
> getting the following error.
> "Active Directory: Unspecified error" The script is pulled right from a
> book, just using it to test doing this.
> Does anyone know what could be wrong? Here is the script.

> Dim Container
> Dim ContainerName
> Dim ComputerToRemove
> ContainerName = "Computers"
> Set Container = GetObject("WinNT://" & ContainerName)
> ComputerToRemove = "06047PCCO"
> Call Container.Delete("Computer", ComputerToRemove)

> Thanks!

Is your domain named "Computers" ???

ContainerName = "MyDomainName"
or
ContainerName = "MyDomainController"

--
Michael Harris
Microsoft.MVP.Scripting
Seattle WA US
--



Tue, 19 Oct 2004 03:28:29 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. setting description on a computer account in AD

2. Computer Accounts not logged into AD for thirty days

3. Adding a computer account to an AD group

4. setting description on a computer account in AD

5. Removing Computer Accounts from NT Domain (with Static Names)

6. How to add/remove an NT Computer account from Domain

7. Adding/Removing user account via VB5.0

8. automatic create user account, computer account in 2000 server

9. Script to add computer to AD domain

10. accessing different account via script

11. VB Script for Computer Account Ownership

12. Modify AD key fields programmatically via ADSI or VB Script

 

 
Powered by phpBB® Forum Software