Announcement

Collapse
No announcement yet.

Automate placement of new computer objects

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Automate placement of new computer objects

    I need to automate the placement of new computer objects to their respective OUs in our AD structure. For example, when a computer from the Chicago site joins the domain it is automatically sent to the Chicago_Computers OU. All computer names are coded with site info, thus a computer from Chicago will be *CHI*, or JSMITHCHI2256.

    I think the best way to do this is with a script that searches the default new computers container for *CHI* and if it finds matches it moves the objects to the Chicago_Computers OU.
    The challenge is that we have about 50 sites.

    Does anyone know of such a script?
    Is a script the best way to perform this task?
    Thanks for your thoughts on this issue.

    -Dave

  • #2
    Re: Automate placement of new computer objects

    A script is reasonable. Another way is to close the Computers container for new computer accounts, and to require that all computer accounts are pre-created in the correct OU. That's probably better in the long run.

    Comment


    • #3
      Re: Automate placement of new computer objects

      Originally posted by wkasdo
      A script is reasonable. Another way is to close the Computers container for new computer accounts, and to require that all computer accounts are pre-created in the correct OU. That's probably better in the long run.

      Didn't know you could do that.

      How do you do it?? - I take it when someone tries to add a computer account withour creating the account they just get an error?

      Interesting.....

      Michael
      Michael Armstrong
      www.m80arm.co.uk
      MCITP: EA, MCTS, MCSE 2003, MCSA 2003: Messaging, CCA, VCP 3.5, 4, 5, VCAP5-DCD, VCAP5-DCA, ITIL, MCP, PGP Certified Technician

      ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

      Comment


      • #4
        Re: Automate placement of new computer objects

        that's how we do it. every computer account is created in the proper OU before a machine is added to the domain.
        if there's a bunch of them to be added, we do that via script specifying the appropiate OUs.
        Yesterday we stood at the edge of the abyss. Today we are a step further...

        Comment


        • #5
          Re: Automate placement of new computer objects

          Though I agree with the logic completely, the pre-create method doesn't work for us because it's rather bureaucratic. We have 50 sites, ten thousand computer objects, and 100 on-site tech personnel spread across the USA. I don't want a ticket opened up everytime someone needs to join a computer to the domain.

          I found this on the MS Script Center. I think it might work but i haven't tested it yet.

          FROM Script Center:
          VBScript to Move a Computer Account
          Description: Moves a computer account from the Computers container in Active Directory to the Finance OU in the same domain.

          *******
          Set objNewOU = GetObject("LDAP://OU=Finance,DC=fabrikam,DC=com")
          Set objMoveComputer = objNewOU.MoveHere _
          ("LDAP://CN=atl-pro-03,CN=Computers,DC=fabrikam,DC=com", "CN=atl-pro-03")

          *******
          My Variation:

          A variation for our environment might look like this (need to test, obviously).
          This variation would move all computers containing *BAT* in their name to the Batesville AR (Arkansas) OU.

          *******
          Set objNewOU = GetObject("LDAP://OU=Computers,OU=Batesville,OU=AR,OU=USA,DC=NA,DC=B OBO,DC=com")
          Set objMoveComputer = objNewOU.MoveHere _ ("LDAP://CN=*BAT*,CN=Computers,DC=NA,DC=BOBO,DC=com", "CN=*BAT*")

          *******
          Question 1: can you use wildcards (*) in VBScript?
          Question 2: can you string multiple VBScripts together into one grande enchilada VBScript?

          I realize I'm asking scripting questions here. May not be correct for the AD forum. Bear with me please.
          Thanks.

          Comment

          Working...
          X