Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Help - Elevate privileges

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,62407
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Help - Elevate privileges
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Help - Elevate privileges - 7/15/2008 8:42:45 PM   
  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 >
 
 
Post #: 1
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Help - Elevate privileges Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts