Re: Move Computer from default OU to another during build process

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Yes sure do you an example or have one handy that I can look at?

Thanks,
Jeff

"Richard Mueller" wrote:

I like to create the computer objects in advance, in the OU's I prefer.
Then, when the machines join the domain, they use the existing object in the
correct OU. Is this possible for you?

--
Richard
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net

"Jeffrey B" <JeffreyB@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:15CA8DD0-06CB-40CB-BE48-523308E6ED89@xxxxxxxxxxxxxxxx
Either or but I prefer during the the building process. This is what I
have
so far
Currently sysprep is doing the adding the workstation to the domain part.
I
want to be able to do a runonce and move the workstation from the
"computers"
container to what ever site it is. I'm sure you already know, by default
all
workstation that you add to the domain will first go to the
"Computers"Container.

our Ous are broken down by sites and I would like to move the workstations
base on their prefered site. Also naming convention is site specific...

Thanks,
Jeff

"RC" wrote:

Jeffrey B,

Are you looking to do this during your build process or are you looking
to
accomplish this on workstations that are already in production?

RC

"Jeffrey B" wrote:

Hello guys I am also looking for script that moves Computer account to
another OU.
Ok,

Base on the script listed below. How would I start if Im moving a
computer
account from the "computer container" to let say "SampleOU"

Thanks

"Richard Mueller" wrote:


Richard,

Thank you for the reply. Unfortunatly I'm fairly new to these
scripting
methods and don't know how to incorporate the desired destination
OU with
your example.

Hi,

I tested the script below (with a different target OU) and it moved
the
computer the script was run on into the target OU. Watch for line
wrapping:
====================
Option Explicit
Dim objNewOU, objSysInfo, strComputerDN, objMoveComputer

' Bind to target OU, where computer object will be moved.
Set objNewOU = GetObject("LDAP://OU=Sales,dc=MyDomain,dc=com";)

' Determine Distinguished Name of local computer.
Set objSysInfo = CreateObject("ADSystemInfo")
strComputerDN = objSysInfo.ComputerName

' Move this computer object to the target OU.
Set objMoveComputer = objNewOU.MoveHere("LDAP://"; & strComputerDN,
vbNullString)

--
Richard
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net






.



Relevant Pages

  • Re: Move Computer from default OU to another during build process
    ... Microsoft MVP Scripting and ADSI ... Currently sysprep is doing the adding the workstation to the domain part. ... I tested the script below (with a different target OU) and it moved ... where computer object will be moved. ...
    (microsoft.public.windows.server.scripting)
  • Re: Disable and Move to a new OU
    ... I assume your text file is a list of the NetBIOS names of computers, ... ' Constants for the NameTranslate object. ... ' Specify the Distinguished Name of the target OU. ... Microsoft MVP Scripting and ADSI ...
    (microsoft.public.scripting.vbscript)
  • Re: Iterations
    ... If you have to dumb all of your scripting down to what can ... > workstation, which is not what the job description was...). ... wellbeing of their infrastructure, and what might happen when you eventually ... > policies or lack thereof. ...
    (microsoft.public.windows.server.scripting)
  • Re: Local or Server Processing of Scripts
    ... >> occurring on the server or the workstation. ... >without needing an install routine first, ... >torgeir, Microsoft MVP Scripting and WMI, Porsgrunn ...
    (microsoft.public.windows.server.scripting)
  • Get the "target" property of shortcuts in a directory
    ... I'm new to scripting and could use some help please... ... I need to get the target of all the shortcuts in users local profile ...
    (microsoft.public.scripting.vbscript)