Computing.Net > Forums > Programming > help with vbs script

help with vbs script

Reply to Message Icon

Original Message
Name: hunleyb
Date: October 14, 2003 at 21:11:29 Pacific
Subject: help with vbs script
OS: win2k
CPU/Ram: 1.8/256
Comment:

I have a vbs script that I'm using to add a global group to the local administrators group. (See Below)

Set oNet = CreateObject("Wscript.Network")
Set com = GetObject("WinNT://" & oNet.ComputerName)
Set LocalGroup = com.GetObject("group", "Administrators")
Set DomainGroup = GetObject("WinNT://MYDOMAIN/WGA,group")
LocalGroup.Add(DomainGroup.AdsPath)
LocalGroup.SetInfo


What I need help with is adding a statement where it would check to see if the group is already added before it does anything. If the group is not added then it will proceed with adding the group. Or if the group is already in the local admin group then the script does nothing. Any help?


Report Offensive Message For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: help with vbs script 

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software