Re: Create computer account in specified AD OUs
- From: "Momo" <momo2804@xxxxxxxxx>
- Date: 1 Dec 2005 22:00:22 -0800
I've found some resources with the following script, however:
'Script configuration
strBase=
"OU=HK,OU=Workstations,OU=HKG,DC=momo,DC=hk,DC=pwcinternal,DC=com"
strComp = "WORKSTATION001"
strDescr = "Test PC"
'ADS_User_Flag_Enum
Const ADS_UF_WORKSTATION_TRUST_ACOUNT = &h1000
Set objCont = GetObject("LDAP://" & strBase)
Set objComp =
objCont.Create("computer","OU=HK,OU=Workstations,OU=HKG,DC=momo,DC=hk,DC=pwcinternal,DC=com"
& StrComp)
objComp.Put "sAMAccountName", StrComp & "$"
objComp.Put "description", strDesc
objCom.Setinfo
WScript.Echo "Computer account for " & StrComp & " created."
But when it actually runs it gives me an error regarding the strComp
value.... any one have ideas on how to fix this..........
I will be running the script from a DC with Domain Admin rights......
.
- References:
- Create computer account in specified AD OUs
- From: Momo
- Create computer account in specified AD OUs
- Prev by Date: Re: FTP script to download, then delete a file who's name changes based on time.
- Next by Date: Re: let user change permission on his home-folder
- Previous by thread: Create computer account in specified AD OUs
- Next by thread: Help with opentext function in vbscript
- Index(es):
Relevant Pages
|