Salut à tous,

J’essaie de récupérer les groupes auquel appartient mon ordinateur sur l'AD.
Lorsque je lance le script il me donne l'erreur suivante :

Ligne : 64
Caract. : 1
Erreur : La propriété répertoire n'est pas présente dans le cache
Code : 8000500D
Sources : Active Directory

Voici la partie de mon script qui génére l'erreur (La ligne 64 correspond à la ligne 11 ci-dessous):

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
20
21
Dim WSHShell, objNET, objSysInfo, objComputer, strComputerDN, strGroups, Group, GroupName, OCSInstall
 
Set WSHShell = WScript.CreateObject("WScript.Shell")
Set objSysInfo = WScript.CreateObject("ADSystemInfo")
strComputerDN = objSysInfo.COMPUTERNAME
WScript.Echo "Computer Name: " & strComputerDN
Set objComputer = GetObject("LDAP://" & strComputerDN) 'Binds the objComputer to the Distiguished Name of the Computer in reference
Set objNetwork = WScript.CreateObject("Wscript.Network")
 
'Vérification de l'appartenance au groupe PR_SERVEUR
strGroups = objComputer.GetEx("memberOf")
OCSInstall=True
For Each Group in strGroups
    Set ThisGroup = GetObject("LDAP://" & Group)
    GroupName = ThisGroup.CN
    Select Case GroupName
        Case "PR_SERVEUR"
		OCSInstall=False
        'WScript.Echo "PR_SERVEUR"
    End Select
Nexts
Je suis sous Win 7, pourtant le même bout de code fonctionne sous XP.

Merci pour votre lumière