lnesta431
Posts: 922
Score: 59 Joined: 1/26/2006 From: Brussels, Belgium Status: offline
|
Hi rbennett This is a part of the script, The way I located a PC in Active Directory. This works in WinPE. strSQL = "SELECT * FROM 'LDAP://domain.com/DC=Domain,DC=COM' Where cn='" & strcomputername & "'" Set oConn = CreateObject("ADODB.Connection") oConn.Provider = "ADSDSOObject" oConn.Open "ADS Provider" Set rs = oConn.Execute(strSQL) on error resume next Set sComputerID = GetObject(rs.Fields(0).Value) Computer = sComputerID.distinguishedName ---------------------------------------------------------------------------- The command that I use to move. (off course the variables are declared, the message boxes are popping me the expected result) The script skipps the MoveHere command. StrNewParentDN = "LDAP://" & strobjectouNEW 'msgbox strnewparentdn strObjectDN = "LDAP://cn=" & strcomputername & "," & strobjectouOLD 'msgbox strObjectDN strObjectRDN = "cn=" & strcomputername 'msgbox strObjectRDN set objCont = GetObject(strNewParentDN) objCont.MoveHere strobjectdn, strobjectrdn ' msgbox "mOVE OK" Set objCont = Nothing Set objObject = Nothing ----------------------------------------------------------------------------------------- What do you mean with not bound? I run the script in the PostInstall phase so the machine has joined to the domain at this point, I just want to move the machine if needed. Thanks! Nico
< Message edited by lnesta431 -- 8/5/2008 1:31:14 AM >
_____________________________
---------- Please rate if this has helped you! Tnx! Check out my NEW blog: http://nicosienaert.blogspot.com/ ----------
|