Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Enum group from a user

Status
Not open for further replies.

gandzy

IS-IT--Management
Jan 7, 2003
1
FR
Hello,

I'm a newbie in vbscript and i don't find any response for this problem :

I have to enumerate all group from an active directory where a user is the manager.

how can I do that ?
Thank you for your help !
 
Here is a script that gets all groups for the logged user. No question of manager or else in it but I think this should help you :
Code:
Dim G_User, Group, Gob_WshEnv

Set Gob_WshEnv = Gob_WshShell.Environment("PROCESS")
Set G_User = GetObject("WinNT://" & Gob_WshEnv.Item("USERDOMAIN")& "/" & WshNetwork.UserName)
For Each Group In G_User.Groups
  Msgbox Group.Name
Next
Water is not bad as long as it stays out human body ;-)
 
Sorry, I forgot defining and initializing "WshNetwork" var in my previous post. Add these lines at the top of the code I gave :
Code:
Dim WshNetwork
Set WshNetwork	= CreateObject("WScript.Network")
Water is not bad as long as it stays out human body ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top