1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
Function cMember(cGroup)
DIM sAdsPath,ocomputer,oGroup,g_oGroupDict
'Peupler dictionnaire si pas encore créé
IF IsEmpty(g_oGroupDict) THEN
SET g_oGroupDict=CreateObject("Scripting.Dictionary")
g_oGroupDict.CompareMode = vbTextCompare
sAdsPath = res.UserDomain &"/"& strComputerName
Wscript.echo sAdsPath
SET ocomputer = GetObject("WinNT://"& sAdsPath & ",computer")
For Each oGroup In ocomputer.Groups
g_oGroupDict.Add oGroup.Name, "-"
Next
SET ocomputer = Nothing
END IF
cMember = CBool(g_oGroupDict.Exists(cGroup))
End Function |
Partager