Bonjour,

Je doit réaliser un script pour faire une recherche d'appartenance a un groupe.
j'ai réussi à le faire pour un users mais pas pour une station.
Voici ma fonction.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
Pourriez vous m'aider ?
Merci