Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Move Computer Account from Domain A to Domain B

Status
Not open for further replies.

acford

MIS
Nov 12, 2003
90
GB
Hi,

I have been reading through the posts and found things similar to what I want but can't seem to get anything to work?!?

I have a bunch of computers in DomainA that I want to move to DomainB... that's all. Windows 2003 servers, XP clients.

I have tried NETDOM but end up with RPC errors, I have also tried sample WMI scripts from MS that I can't get to work...

Is there not just a little code I can use?!? I do not want to change hostnames, or local admin passwords, or join to workgroups...

Thanks muchly
ACF
 
Hello, do you have the two way trust setup between the respective domains?

What account are you using to create\move the AD resources?

Did you test the Ldap connection to Domain B?

 
Yes there is a 2 way trust between DomainA and DomainB... what can I run to show this?

I am using an admin account that is an admin in both Domain's

I'm not sure how to test an LDAP connection...
 
What script(s) have you tried?

I don't have a second domain to try to move computer accounts to.

I would recomend having a trial domain setup to test something like this with! This is a MOVE and not a copy.

[!]Untested[/!]
Code:
Const ADS_SCOPE_SUBTREE = 2



' Bind to current Domain and set some values
Set objRootDSE = GetObject("LDAP://rootDSE")
strDomain = "LDAP://" & objRootDSE.Get("defaultNamingContext")
Set objDomain = GetObject(strDomain)
arrSplADSDomain = Split(strDomain,"//")
strSplADSDomain = arrSplADSDomain(1)


Set objOU = GetObject("LDAP://cn=Computers," & strSplADSDomain)

objOU.MoveHere "LDAP://cn=Computer01,cn=Users,dc=fabrikam,dc=com", _
    vbNullString

WScript.Quit

Thanks

John Fuhrman
Titan Global Services
 
Right, running that script gives me the error:

The server is unwilling to process the request

Is this an authentication issue? Can I put a username/password in that script?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top