This script can be handy if you build your servers into a BUILD OU and then need to automate moving the server to the correct OU later in the build process.
' Move Computer to Prod Citrix OU
Set WshNetwork = WScript.CreateObject("WScript.Network")
StrComputername= "CN=" & WshNetwork.ComputerName
Set objNewOU = GetObject("LDAP://OU=Live PS45,OU=Citrix W2K3,OU=Servers,DC=thinworld,DC=net")
StrOldOU= "LDAP://" & StrComputername & ",CN=Build ,CN=Servers,DC=thinworld,DC=net"
Set objMoveComputer = objNewOU.MoveHere _
(StroldOU, StrComputerName)
No comments:
Post a Comment