3 Replies Latest reply on Jun 11, 2008 8:56 AM by mike1210

    Unattended XP Install - Add device to an Active Directory OU

    Rookie

       

      I can get a device to be added to our domain, but is there a way with the scripted install to get a device to be added to a certain OU?

       

       

      I was looking for a way similiar to when you deploy a windows pe image, under the SysPrep Options->Network Credentials

       

       

        • 1. Re: Unattended XP Install - Add device to an Active Directory OU
          Rookie

           

          Im not sure I fully understand you but on our LANdesk under SysPrep Options->Network Credentials there is a tick box "add device to OU" that would place it in a particaular OU and also it can be done with the sysprep.inf on the actual machine with entries as below

           

           

           

           

           

              DomainAdmin=username

              DomainAdminPassword=password

              JoinDomain=test.ac.uk

              MachineObjectOU="OU=Computers,OU=Resources,DC=test,DC=ac,DC=uk"

           

           

          or do you mean moved OU once the scripts ect have been ran?

           

           

           

           

           

          • 2. Re: Unattended XP Install - Add device to an Active Directory OU
            Rookie

            I am doing an unattended install, using a template.  One of my Post-OS configs is to join the computer to the domain.  So that will add the computer to the default OU (Computers) in our domain.  However I want to be able to directly add the computer to the computers OU belonging to our campus, instead of the defauly computers OU for the domain.  I was wondering if there is a similiar method to the SysPrep options that can be used in my scripted install template

            • 3. Re: Unattended XP Install - Add device to an Active Directory OU
              Rookie

              I have done something similar with a VB script which one of my colleagues wrote that can move a computer from one OU to another, here it moves the computer from the "newcomputers" OU into the CCG OU

               

              the account used is called wsadd which has been delegated rights to add/remove computer objects in computer OU's

               

               

               

               

               

               

               

               

              'Get the NETBIOS name of the domain

              Set objSystemInfo = CreateObject("ADSystemInfo")

              strDomain = objSystemInfo.DomainShortName

              ' Get the name of the computer

              set objNetwork = createobject("Wscript.Network")

              strComputer = objNetwork.ComputerName

              strComputerDN = "CN=" & strComputer & ",OU=NewComputers,DC=UNI,DC=glam,DC=ac,DC=uk"

               

               

              'Move to

              strComputerTo = "OU=CCG,OU=Student,OU=Test,OU=Resources,DC=UNI,DC=glam,DC=ac,DC=uk"

               

               

              set ldapObj = GetObject("LDAP:")

              set adComp=ldapObj.OpenDSObject("LDAP://uni-dc1.uni.glam.ac.uk/" & strComputerTo,"wsadd","xxxpasswordxxx",1)

               

               

              ' Move computer to OU

              adComp.MoveHere "LDAP://" & strComputerDN, vbNullString

               

               

               

               

               

               

               

               

              So if you're domain is called test.com and the computers are in the default computers container it would be below....if you moved them to say an OU called NewComputers, please note where it says

               

               

              set adComp=ldapObj.OpenDSObject("LDAP://DC1.test.com/" & strComputerTo,"wsadd","xxxpasswordxxx",1)

               

               

              DC1.test.com is the FQDN of a domin controller NOT the domain itself

               

               

               

               

               

               

               

               

              'Get the NETBIOS name of the domain

              Set objSystemInfo = CreateObject("ADSystemInfo")

              strDomain = objSystemInfo.DomainShortName

              ' Get the name of the computer

              set objNetwork = createobject("Wscript.Network")

              strComputer = objNetwork.ComputerName

              strComputerDN = "CN=" & strComputer & ",CN=Computers,DC=test,DC=com"

               

               

              'Move to

              strComputerTo = "OU=NewComputers,DC=test,DC=com"

               

               

              set ldapObj = GetObject("LDAP:")

              set adComp=ldapObj.OpenDSObject("LDAP://DC1.test.com/" & strComputerTo,"wsadd","xxxpasswordxxx",1)

               

               

              ' Move computer to OU

              adComp.MoveHere "LDAP://" & strComputerDN, vbNullString