Re: Move Computer from default OU to another during build process
- From: Jeffrey B <JeffreyB@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 26 Oct 2006 12:45:02 -0700
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
- Follow-Ups:
- Re: Move Computer from default OU to another during build process
- From: Richard Mueller
- Re: Move Computer from default OU to another during build process
- Prev by Date: Re: Need to read "Store password in reversible encryption for all users in the domain"
- Next by Date: NT 4.0 - How to get memory used and ID for processes
- Previous by thread: Re: Scripting Telnet
- Next by thread: Re: Move Computer from default OU to another during build process
- Index(es):
Relevant Pages
|