Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Cheking if a user belongs to a group

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Cheking if a user belongs to 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 >>
 Cheking if a user belongs to a group - 11/15/2005 8:14:28 PM   
  marino222

 

Posts: 26
Score: 0
Joined: 11/15/2005
Status: offline
Hi everyboy...
i need help on a script that cheks if a user(let say Admin) belongs to a the groups(let say Administrator and User).
Someone nows how to do?
thanks
 
 
Post #: 1
 
 RE: Cheking if a user belongs to a group - 11/16/2005 6:39:46 AM   
  didorno

 

Posts: 361
Score: 0
Joined: 2/12/2005
From:
Status: offline
marino222, maybe you can use the next example from the System Administration Guide,
part of the Windows .NET Server Resource Kit.

Set objUser = GetObject _
("LDAP://cn=myerken,ou=management,dc=fabrikam,dc=com")

WScript.Echo "Distinguished Name: " & VbCrLf & _
objUser.Get("distinguishedName")

objMemberOf = objUser.GetEx("MemberOf")
WScript.Echo VbCrLf & "The user is a member of:"
For Each Group in objMemberOf
Wscript.echo Group
Next
Good luck !

_____________________________

Regular Expression ? I (L+o{1,}v{1,3}e\s)+[iI]t!$

(in reply to marino222)
 
 
Post #: 2
 
 
 
  

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 >> Cheking if a user belongs to 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