Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Is computer member of a group

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Is computer member of a group
  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 >>
 Is computer member of a group - 12/10/2007 4:00:52 PM   
  Syslq

 

Posts: 3
Score: 0
Joined: 6/4/2007
Status: offline
I'm trying to make a script that would allow me to check if a computer is a member of certain group and perform some action based on the answer on that.
All I can find are examples for users.
If anyone has any ideas I'm thankfull.

ps. I did write a script that uses text file with computer names in it and if computer on wich script is executing find's itself in txt file there is a function call otherwise it's new iteration but that doesnt suit me so well.
 
 
Post #: 1
 
 RE: Is computer member of a group - 12/10/2007 4:38:58 PM   
  sheepz


Posts: 247
Score: 2
Joined: 3/17/2006
From: Riverside the 909s
Status: offline
you could try something like this:

Set CurrentComputer = GetObject("LDAP://" & ADSysInfo.ComputerName)
strGroups = LCase(Join(CurrentComputer.MemberOf)) 'Check membership
Select Case GroupMember
      Case a = InStr(strGroup, HR)
           HRSub
      Case b = InStr(strGroup, SALES)
           SalesSub
      Case c = InStr(strGroup, MARKETING)
           MarketingSub
End Select

(in reply to Syslq)
 
 
Post #: 2
 
 RE: Is computer member of a group - 12/10/2007 4:47:57 PM  1 votes
  sheepz


Posts: 247
Score: 2
Joined: 3/17/2006
From: Riverside the 909s
Status: offline
opps just read this post.  this should help:  http://visualbasicscript.com/m_54056/tm.htm

(in reply to Syslq)
 
 
Post #: 3
 
 
 
  

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 >> Is computer member of a group 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