Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Add an Active Directory Global Group to a Local Group on a Computer

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> Post a VBScript >> Add an Active Directory Global Group to a Local Group on a Computer
  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 >>
 Add an Active Directory Global Group to a Local Group o... - 10/7/2005 7:27:19 AM   
  Lancelot

 

Posts: 3
Score: 0
Joined: 10/2/2005
Status: offline
'VBScript to Add an Active Directory Global Group to a Local Group on a Computer
'
'Example: Add an Active Directory General Desktop Administrator Group to the Local
'         Administrator Group. this can be Used to provide Local Administrator rights
'         to AD Users.
'
'MyDomain is in the form e.g Menkaura.com
'Global Group is in form e.g Local Desktop Administrator User Rights
'
'Provided by http://www.Menkaura.com/Forum/index.php
'Visit us to see what else we have on offer.


Option Explicit
On Error Resume Next

'Define Variables
Dim Mydomain
Dim GlobalGroup
Dim oDomainGroup
Dim oLocalAdmGroup
Dim oNet
Dim sComputer

Set oNet = WScript.CreateObject("WScript.Network")
sComputer = oNet.ComputerName


MyDomain = "Place Your Domain Name Here"
GlobalGroup = "Local Desktop Administrator User Rights"

Set oDomainGroup = GetObject("WinNT://" & MyDomain & "/" & GlobalGroup & ",group")
Set oLocalAdmGroup = GetObject("WinNT://" & sComputer & "/Administrators,group")

oLocalAdmGroup.Add(oDomainGroup.AdsPath)


'Nullify Variables
Set Mydomain = Nothing
Set GlobalGroup = Nothing
Set oDomainGroup = Nothing
Set oLocalAdmGroup = Nothing
Set oNet = Nothing
Set sComputer = Nothing

_____________________________

Regards, John

Find me at: http://www.Menkaura.com/Forum/index.php
 
 
Post #: 1
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> Post a VBScript >> Add an Active Directory Global Group to a Local Group on a Computer 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