Doc,

You could add a section like this to Sysprep.inf:
code:
[Identification]
JoinDomain=YourDomain.com
DomainAdmin=2kAddUser
DomainAdminPassword=win2kAddUser
MachineObjectOU="OU=NewPC,DC=YourDomain,DC=com"

This will only ask for the computername during install off the ghosted image, and the computer will join AD in the OU: NewPC

This ofcourse requires than you have added the OU: NewPC
to the root of the domain, and created the user: win2kAddUser

In My domain the user: win2kAddUser
is a domain user with elevated priveliges to the OU: NewPC
(win2kAddUser can add computers to OU: NewPC)
NOT a DomainAdmin as stated in the Identification section, but this is enough!

Don't be afraid of the password in plain text in sysprep.inf, because the folder: C:\Sysprep
is automatically removed during the first boot, so it's sort of paranoia to make the special user: 2kAddUser

You can now use the LDAP: move computer (Something like this)
code:
Function MoveToOU($WS,$ToOU,$From)
Dim $objToOU

$objToOU = GetObject('LDAP://' + $ToOU)
If @Error
Exit @Error
EndIf
$RC = $objToOU.MoveHere('LDAP://' + $WS + ',' + $From, $WS)
Exit @Error
EndFunction

Parameters for: MoveToOU()
  • $FromOU being: 'OU=NewPC,DC=YourDomain,DC=com'
  • $ToOU being ie.: 'OU=Office,OU=Department,DC=YourDomain,DC=com'
  • $WS being: 'CN=NameOfWS' (Sustittute: NameOfWS whit the real name of the workstation)
-Erik


Ps.
I have a serverside script that checks for comcuters in the OU: NewPC
and automatically moves them to the appropritate OU based on ini-files

[ 27. June 2003, 01:04: Message edited by: kholm ]