Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


What's VB's equivalent of Ifmember.exe?

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> What's VB's equivalent of Ifmember.exe?
  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 >>
 What's VB's equivalent of Ifmember.exe? - 5/31/2005 1:01:17 AM   
  Coquito

 

Posts: 29
Score: 0
Joined: 4/20/2005
From: USA
Status: offline
Ifmember.exe checks whether the current user is a member of a specified group. How would this be done in VB/WSH?
 
 
Post #: 1
 
 Re: What's VB's equivalent of Ifmember.exe? - 5/31/2005 2:27:14 AM   
  royb5000

 

Posts: 54
Score: 0
Joined: 5/4/2005
From: USA
Status: offline
Here is one that I have used that i picked up somewhere and it works pretty nice.



'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

'%%%%%%%%%%%%%%%%%%%%%%%%%%%%ISMEMBER Function%%%%%%%%%%%%%%%%%%%%%%%

'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



Function ISMEMBER(groupName)



If IsEmpty(groupListD) then

Set groupListD = CreateObject("Scripting.Dictionary")
'50
groupListD.CompareMode =TextCompare

ADSPath = currentDomain & "/" & currentUser

set userPath = GetObject("WinNT://" & ADSPath & ",user")

for each listGroup in userPath.Groups



groupListD.Add listGroup.Name, "-"

Next



end if



ISMEMBER = CBool(groupListD.Exists(groupName))



End Function

(in reply to Coquito)
 
 
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 >> What's VB's equivalent of Ifmember.exe? 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