Just working on a script to return boolean if user is a member of group. However I want to go one step further and also list subgroups of groups etc...This is what I have at the moment
Private Function IsMember(groupName)
Set netObj = CreateObject("WScript.Network")
domain = "domain.local"
user = netObj.UserName
flgIsMember = false
Set userObj = GetObject("WinNT://" & domain & "/" & user & ",user")
For Each grp In userObj.Groups
if LCase(grp.Name) = LCase(groupname) then
IsMember = flgIsMember
Set userObj = nothing
Set netObj = nothing
I want it so I can go one step further in the For Loop so I can search subgroups as well...Any assistance would be much appreciated.