| |
pompey_john
Posts: 3
Score: 0
Joined: 7/15/2008
Status: offline
|
Hi Everyone, Before I begin, please excuse me if I get some of this wrong, I am very new to VBScript and doing things within AD. To fill you in on the background..... I have recently assembled a script for new PC builds that after sysprep will name the machine, join it to the domain to a specified OU and now I would like to add the machine to some software GPO's. The machine is set to logon as the local administrator for each of these stages and so far all bar the last are working without fault. My problem is that the local administrator has no right to AD therefore my script will not work, is there a way to elevate the privileges or logon to AD within the script. I do have an account available to do this as it is used to name the machine and join the domain. So far the relevant part of the script is as follows :- 'Capture Local Machine Name Set objNetwork = CreateObject("Wscript.Network") strComputerName = "CN=" & ucase((objnetwork.computername)) 'Capture AD Root Domain Information Set objRootLDAP = GetObject("LDAP://RootDSE") strDNSDomain = objRootLDAP.Get("DefaultNamingContext") 'Add Machine Object to GPO Object strGPOName = "CN=SW - Adobe Acrobat Reader 8.0.0 (XP)" strGPOLocation = "OU=Unlicensed,OU=_Generic Software,OU=Software Distribution" strOUName = "ou=Computers_Imaged" Set objGroup = GetObject ("LDAP://" &strGPOName& "," &strGPOLocation& "," &StrDNSDomain) Set ocomputer = GetObject ("LDAP://" &strComputerName& "," &strOUName& "," &strDNSDomain) objGroup.add ocomputer.adspath Thank you in advance for reading this and hopefully somebody will be able to help. John
< Message edited by pompey_john -- 7/15/2008 11:30:14 PM >
|
|