Connection à Active Directory

Le
Nolofinwe Melwazul
Lut,

Voila, j'ai fait un code qui affiche l'AD dans un treeview (enfin presque
;p) pake le souci c ke j'arrive pas a mi connecté à l'AD.

l'erreur se situe ici : Set OBJ_AD_REFERENCE = GetObject(STR_AD_REFERENCE)

avec STR_AD_REFERENCE = "racineforetAD" est ce bon ? je n'ai pas trouve de
lien sur les msdn et j'ai detaillé un max les objets. Une partie de ce code
est tout ce que j'ai trouvé sur la question.


Merci de votre aide, Guy voici mon code:

'
=
' DEFINITONS
'
=
Dim P1 As String
Dim P2 As Boolean
Dim P3 As Boolean
Dim P4 As Boolean
Dim P5 As Boolean
Dim P6 As Boolean
Dim P7 As Boolean
Dim P8 As Boolean
Dim P9 As Boolean

Dim OBJ_AD_REFERENCE As Object
Dim OBJ_TEMP_PARENT As Object
Dim OBJ_TEMP As Object
Dim OBJ_NODE As Node
Dim OBJ_OBJECT_ICONE As Object
Dim OBJ_IS_CONTAINER As Object

Public Sub DO_AD_TREEBUILD(OBJ_TREEVIEW As Object, OBJ_IMAGELIST As Object,
STR_AD_REFERENCE As String, BOL_VIEW_DEFAULTCONTAINERS As Boolean,
BOL_VIEW_OUS As Boolean, BOL_VIEW_USERS As Boolean, BOL_VIEW_GROUPS As
Boolean, BOL_VIEW_COMPUTERS As Boolean, BOL_VIEW_PRINTERS As Boolean,
BOL_VIEW_SHARES As Boolean, BOL_VIEW_TYPE As Boolean)
'
==
' OBJ_TREEVIEW = Objet TreeView dans lequel construire la vue
' OBJ_IMAGELIST = Objet Imagelist de référence pour les images
' P1 > STR_AD_REFERENCE = chemin LDAP ( Conteneur ) qui sert de point
de départ
' P2 > BOL_VIEW_DEFAULTCONTAINERS = Visibilité des conteneurs par défaut AD
' P3 > BOL_VIEW_OUS = Visibilité des UOs
' P4 > BOL_VIEW_USERS = Visibilité des Utilisateurs
' P5 > BOL_VIEW_GROUPS = Visibilité des Groupes
' P6 > BOL_VIEW_COMPUTERS = Visibilité des Ordinateurs
' P7 > BOL_VIEW_PRINTERS = Visibilité des Imprimantes
' P8 > BOL_VIEW_SHARES = Visibilité des Partages
' P9 > BOL_VIEW_TYPE = Type de vue utilisée ( True=Arbre,
False=Plane )
'
==

P1 = STR_AD_REFERENCE
P2 = True
P3 = True
P4 = BOL_VIEW_USERS
P5 = BOL_VIEW_GROUPS
P6 = BOL_VIEW_COMPUTERS
P7 = BOL_VIEW_PRINTERS
P8 = BOL_VIEW_SHARES
P9 = BOL_VIEW_TYPE

OBJ_TREEVIEW.Nodes.Clear
OBJ_TREEVIEW.ImageList = OBJ_IMAGELIST
Set OBJ_AD_REFERENCE = GetObject(STR_AD_REFERENCE)

If P9 = True Then
Set OBJ_NODE = OBJ_TREEVIEW.Nodes.Add(, , OBJ_AD_REFERENCE.ADsPath,
Mid(OBJ_AD_REFERENCE.Name, 4), 1)
OBJ_NODE.Expanded = True
End If

Call DO_RECURSE_TREE(OBJ_TREEVIEW, OBJ_AD_REFERENCE)

End Sub

Private Sub DO_RECURSE_TREE(OBJ_TREEVIEW As Object, ByVal OBJ_TEMP_PARENT As
Object)
'
=
' BOUCLE RECURSIVE PARENT/ENFANT OBJETS ADS
'
=
For Each OBJ_TEMP In OBJ_TEMP_PARENT

Call DO_ADD_NODE(OBJ_TREEVIEW, OBJ_TEMP_PARENT, OBJ_TEMP)
If FUN_IS_CONTAINER(OBJ_TEMP) = True Then Call
DO_RECURSE_TREE(OBJ_TREEVIEW, OBJ_TEMP)

Next

End Sub

Private Sub DO_ADD_NODE(OBJ_TREEVIEW As Object, OBJ_TEMP_PARENT As Object,
OBJ_TEMP As Object)
'
=
' AJOUTE UN NOEUD ENFANT
'
=
If FUN_IS_VISIBLE(OBJ_TEMP) = False Then Exit Sub

If P9 = True Then Set OBJ_NODE =
OBJ_TREEVIEW.Nodes.Add(OBJ_TEMP_PARENT.ADsPath, tvwChild, OBJ_TEMP.ADsPath,
Mid(OBJ_TEMP.Name, 4), FUN_OBJECT_ICON(OBJ_TEMP))
If P9 = False And FUN_IS_CONTAINER(OBJ_TEMP) = False And
FUN_OBJECT_ICON(OBJ_TEMP) <> 9 Then Set OBJ_NODE = OBJ_TREEVIEW.Nodes.Add(,
, OBJ_TEMP.ADsPath, Mid(OBJ_TEMP.Name, 4), FUN_OBJECT_ICON(OBJ_TEMP))

End Sub

Private Function FUN_OBJECT_ICON(OBJ_OBJECT_ICON As Object)
'
=
' FONCTION POUR RETROUNER L'ICONE D'UN OBJET
'
=
FUN_OBJECT_ICON = 9
If FUN_IS_CONTAINER(OBJ_OBJECT_ICON) = True And OBJ_OBJECT_ICON.Class <>
"organizationalUnit" Then FUN_OBJECT_ICON = 2
If OBJ_OBJECT_ICON.Class = "organizationalUnit" Then FUN_OBJECT_ICON = 3
If OBJ_OBJECT_ICON.Class = "user" Then FUN_OBJECT_ICON = 4
If OBJ_OBJECT_ICON.Class = "group" Then FUN_OBJECT_ICON = 5
If OBJ_OBJECT_ICON.Class = "computer" Then FUN_OBJECT_ICON = 6
If OBJ_OBJECT_ICON.Class = "printer" Then FUN_OBJECT_ICON = 7
If OBJ_OBJECT_ICON.Class = "volume" Then FUN_OBJECT_ICON = 8

End Function

Private Function FUN_IS_CONTAINER(OBJ_IS_CONTAINER As Object)
'
=
' FONCTION DE DEFINITION D'UN CONTENEUR
'
=
FUN_IS_CONTAINER = False

If OBJ_IS_CONTAINER.Class = "builtinDomain" Then FUN_IS_CONTAINER = True
If OBJ_IS_CONTAINER.Class = "container" Then FUN_IS_CONTAINER = True
If OBJ_IS_CONTAINER.Class = "lostAndFound" Then FUN_IS_CONTAINER = True
If OBJ_IS_CONTAINER.Class = "organizationalUnit" Then FUN_IS_CONTAINER =
True
If OBJ_IS_CONTAINER.Class = "domainPolicy" Then FUN_IS_CONTAINER = True
If OBJ_IS_CONTAINER.Class = "dfsConfiguration" Then FUN_IS_CONTAINER =
True
If OBJ_IS_CONTAINER.Class = "nTFRSSettings" Then FUN_IS_CONTAINER = True
If OBJ_IS_CONTAINER.Class = "nTFRSReplicaSet" Then FUN_IS_CONTAINER =
True
If OBJ_IS_CONTAINER.Class = "fileLinkTracking" Then FUN_IS_CONTAINER =
True
If OBJ_IS_CONTAINER.Class = "rpcContainer" Then FUN_IS_CONTAINER = True
If OBJ_IS_CONTAINER.Class = "linkTrackVolumeTable" Then FUN_IS_CONTAINER
= True
If OBJ_IS_CONTAINER.Class = "groupPolicyContainer" Then FUN_IS_CONTAINER
= True

End Function

Private Function FUN_IS_VISIBLE(OBJ_IS_VISIBLE As Object)
'
=
' FONCTION DE DEFINITION DE LA VISIBILITE D'UN OBJET
'
=
FUN_IS_VISIBLE = True
If OBJ_IS_VISIBLE.Class = "user" And P4 = False Then FUN_IS_VISIBLE =
False
If OBJ_IS_VISIBLE.Class = "group" And P5 = False Then FUN_IS_VISIBLE =
False
If OBJ_IS_VISIBLE.Class = "computer" And P6 = False Then FUN_IS_VISIBLE
= False
If OBJ_IS_VISIBLE.Class = "printer" And P7 = False Then FUN_IS_VISIBLE =
False
If OBJ_IS_VISIBLE.Class = "volume" And P8 = False Then FUN_IS_VISIBLE =
False
End Function

Private Sub Form_Load()
Call DO_AD_TREEBUILD(TreeView1, ImageList1, "LBLBLT", True, True, True,
True, True, True, False, False)
End Sub

  • Partager ce contenu :
Vos réponses
Trier par : date / pertinence
Nolofinwe Melwazul
Le #12871291
Help !



"Nolofinwe Melwazul" news:
Lut,

Voila, j'ai fait un code qui affiche l'AD dans un treeview (enfin presque
;p) pake le souci c ke j'arrive pas a mi connecté à l'AD.

l'erreur se situe ici : Set OBJ_AD_REFERENCE = GetObject(STR_AD_REFERENCE)

avec STR_AD_REFERENCE = "racineforetAD" est ce bon ? je n'ai pas trouve


de
lien sur les msdn et j'ai detaillé un max les objets. Une partie de ce


code
est tout ce que j'ai trouvé sur la question.


Merci de votre aide, Guy voici mon code:




'========================================================================== > ========= > ' DEFINITONS



'========================================================================== > ========= > Dim P1 As String
Dim P2 As Boolean
Dim P3 As Boolean
Dim P4 As Boolean
Dim P5 As Boolean
Dim P6 As Boolean
Dim P7 As Boolean
Dim P8 As Boolean
Dim P9 As Boolean

Dim OBJ_AD_REFERENCE As Object
Dim OBJ_TEMP_PARENT As Object
Dim OBJ_TEMP As Object
Dim OBJ_NODE As Node
Dim OBJ_OBJECT_ICONE As Object
Dim OBJ_IS_CONTAINER As Object

Public Sub DO_AD_TREEBUILD(OBJ_TREEVIEW As Object, OBJ_IMAGELIST As


Object,
STR_AD_REFERENCE As String, BOL_VIEW_DEFAULTCONTAINERS As Boolean,
BOL_VIEW_OUS As Boolean, BOL_VIEW_USERS As Boolean, BOL_VIEW_GROUPS As
Boolean, BOL_VIEW_COMPUTERS As Boolean, BOL_VIEW_PRINTERS As Boolean,
BOL_VIEW_SHARES As Boolean, BOL_VIEW_TYPE As Boolean)



'========================================================================== > ========== > ' OBJ_TREEVIEW = Objet TreeView dans lequel construire la vue
' OBJ_IMAGELIST = Objet Imagelist de référence pour les images
' P1 > STR_AD_REFERENCE = chemin LDAP ( Conteneur ) qui sert de


point
de départ
' P2 > BOL_VIEW_DEFAULTCONTAINERS = Visibilité des conteneurs par défaut


AD
' P3 > BOL_VIEW_OUS = Visibilité des UOs
' P4 > BOL_VIEW_USERS = Visibilité des Utilisateurs
' P5 > BOL_VIEW_GROUPS = Visibilité des Groupes
' P6 > BOL_VIEW_COMPUTERS = Visibilité des Ordinateurs
' P7 > BOL_VIEW_PRINTERS = Visibilité des Imprimantes
' P8 > BOL_VIEW_SHARES = Visibilité des Partages
' P9 > BOL_VIEW_TYPE = Type de vue utilisée ( True=Arbre,
False=Plane )



'========================================================================== > ========== >
P1 = STR_AD_REFERENCE
P2 = True
P3 = True
P4 = BOL_VIEW_USERS
P5 = BOL_VIEW_GROUPS
P6 = BOL_VIEW_COMPUTERS
P7 = BOL_VIEW_PRINTERS
P8 = BOL_VIEW_SHARES
P9 = BOL_VIEW_TYPE

OBJ_TREEVIEW.Nodes.Clear
OBJ_TREEVIEW.ImageList = OBJ_IMAGELIST
Set OBJ_AD_REFERENCE = GetObject(STR_AD_REFERENCE)

If P9 = True Then
Set OBJ_NODE = OBJ_TREEVIEW.Nodes.Add(, ,


OBJ_AD_REFERENCE.ADsPath,
Mid(OBJ_AD_REFERENCE.Name, 4), 1)
OBJ_NODE.Expanded = True
End If

Call DO_RECURSE_TREE(OBJ_TREEVIEW, OBJ_AD_REFERENCE)

End Sub

Private Sub DO_RECURSE_TREE(OBJ_TREEVIEW As Object, ByVal OBJ_TEMP_PARENT


As
Object)



'========================================================================== > ========= > ' BOUCLE RECURSIVE PARENT/ENFANT OBJETS ADS



'========================================================================== > ========= > For Each OBJ_TEMP In OBJ_TEMP_PARENT

Call DO_ADD_NODE(OBJ_TREEVIEW, OBJ_TEMP_PARENT, OBJ_TEMP)
If FUN_IS_CONTAINER(OBJ_TEMP) = True Then Call
DO_RECURSE_TREE(OBJ_TREEVIEW, OBJ_TEMP)

Next

End Sub

Private Sub DO_ADD_NODE(OBJ_TREEVIEW As Object, OBJ_TEMP_PARENT As Object,
OBJ_TEMP As Object)



'========================================================================== > ========= > ' AJOUTE UN NOEUD ENFANT



'========================================================================== > ========= > If FUN_IS_VISIBLE(OBJ_TEMP) = False Then Exit Sub

If P9 = True Then Set OBJ_NODE > OBJ_TREEVIEW.Nodes.Add(OBJ_TEMP_PARENT.ADsPath, tvwChild,


OBJ_TEMP.ADsPath,
Mid(OBJ_TEMP.Name, 4), FUN_OBJECT_ICON(OBJ_TEMP))
If P9 = False And FUN_IS_CONTAINER(OBJ_TEMP) = False And
FUN_OBJECT_ICON(OBJ_TEMP) <> 9 Then Set OBJ_NODE OBJ_TREEVIEW.Nodes.Add(,
, OBJ_TEMP.ADsPath, Mid(OBJ_TEMP.Name, 4), FUN_OBJECT_ICON(OBJ_TEMP))

End Sub

Private Function FUN_OBJECT_ICON(OBJ_OBJECT_ICON As Object)



'========================================================================== > ========= > ' FONCTION POUR RETROUNER L'ICONE D'UN OBJET



'========================================================================== > ========= > FUN_OBJECT_ICON = 9
If FUN_IS_CONTAINER(OBJ_OBJECT_ICON) = True And OBJ_OBJECT_ICON.Class


<>
"organizationalUnit" Then FUN_OBJECT_ICON = 2
If OBJ_OBJECT_ICON.Class = "organizationalUnit" Then FUN_OBJECT_ICON 3
If OBJ_OBJECT_ICON.Class = "user" Then FUN_OBJECT_ICON = 4
If OBJ_OBJECT_ICON.Class = "group" Then FUN_OBJECT_ICON = 5
If OBJ_OBJECT_ICON.Class = "computer" Then FUN_OBJECT_ICON = 6
If OBJ_OBJECT_ICON.Class = "printer" Then FUN_OBJECT_ICON = 7
If OBJ_OBJECT_ICON.Class = "volume" Then FUN_OBJECT_ICON = 8

End Function

Private Function FUN_IS_CONTAINER(OBJ_IS_CONTAINER As Object)



'========================================================================== > ========= > ' FONCTION DE DEFINITION D'UN CONTENEUR



'========================================================================== > ========= > FUN_IS_CONTAINER = False

If OBJ_IS_CONTAINER.Class = "builtinDomain" Then FUN_IS_CONTAINER True
If OBJ_IS_CONTAINER.Class = "container" Then FUN_IS_CONTAINER = True
If OBJ_IS_CONTAINER.Class = "lostAndFound" Then FUN_IS_CONTAINER True
If OBJ_IS_CONTAINER.Class = "organizationalUnit" Then FUN_IS_CONTAINER


> True
If OBJ_IS_CONTAINER.Class = "domainPolicy" Then FUN_IS_CONTAINER True
If OBJ_IS_CONTAINER.Class = "dfsConfiguration" Then FUN_IS_CONTAINER > True
If OBJ_IS_CONTAINER.Class = "nTFRSSettings" Then FUN_IS_CONTAINER True
If OBJ_IS_CONTAINER.Class = "nTFRSReplicaSet" Then FUN_IS_CONTAINER > True
If OBJ_IS_CONTAINER.Class = "fileLinkTracking" Then FUN_IS_CONTAINER > True
If OBJ_IS_CONTAINER.Class = "rpcContainer" Then FUN_IS_CONTAINER True
If OBJ_IS_CONTAINER.Class = "linkTrackVolumeTable" Then


FUN_IS_CONTAINER
= True
If OBJ_IS_CONTAINER.Class = "groupPolicyContainer" Then


FUN_IS_CONTAINER
= True

End Function

Private Function FUN_IS_VISIBLE(OBJ_IS_VISIBLE As Object)



'========================================================================== > ========= > ' FONCTION DE DEFINITION DE LA VISIBILITE D'UN OBJET



'========================================================================== > ========= > FUN_IS_VISIBLE = True
If OBJ_IS_VISIBLE.Class = "user" And P4 = False Then FUN_IS_VISIBLE > False
If OBJ_IS_VISIBLE.Class = "group" And P5 = False Then FUN_IS_VISIBLE > False
If OBJ_IS_VISIBLE.Class = "computer" And P6 = False Then


FUN_IS_VISIBLE
= False
If OBJ_IS_VISIBLE.Class = "printer" And P7 = False Then FUN_IS_VISIBLE


> False
If OBJ_IS_VISIBLE.Class = "volume" And P8 = False Then FUN_IS_VISIBLE


> False
End Function

Private Sub Form_Load()
Call DO_AD_TREEBUILD(TreeView1, ImageList1, "LBLBLT", True, True,


True,
True, True, True, False, False)
End Sub




Nolofinwe Melwazul
Le #12871281
Yop,

G du nouveau, g ecris un code pour afficher AD ds un treeview, le pb se
situe a la connection, je ne sais pas quelle valeur mettre ds GetObject()
mon programme tourne mais n'affiche rien ds le treeview.

g mis plein de truc mais ce qui semblait le + logik :
LDAP://IP_SERV_DOM/DC=NOM_DOMAINE

mais marche pas.

merci de votre aide.

"Nolofinwe Melwazul" news:
Lut,

Voila, j'ai fait un code qui affiche l'AD dans un treeview (enfin presque
;p) pake le souci c ke j'arrive pas a mi connecté à l'AD.

l'erreur se situe ici : Set OBJ_AD_REFERENCE = GetObject(STR_AD_REFERENCE)

avec STR_AD_REFERENCE = "racineforetAD" est ce bon ? je n'ai pas trouve


de
lien sur les msdn et j'ai detaillé un max les objets. Une partie de ce


code
est tout ce que j'ai trouvé sur la question.


Merci de votre aide, Guy voici mon code:




'========================================================================== > ========= > ' DEFINITONS



'========================================================================== > ========= > Dim P1 As String
Dim P2 As Boolean
Dim P3 As Boolean
Dim P4 As Boolean
Dim P5 As Boolean
Dim P6 As Boolean
Dim P7 As Boolean
Dim P8 As Boolean
Dim P9 As Boolean

Dim OBJ_AD_REFERENCE As Object
Dim OBJ_TEMP_PARENT As Object
Dim OBJ_TEMP As Object
Dim OBJ_NODE As Node
Dim OBJ_OBJECT_ICONE As Object
Dim OBJ_IS_CONTAINER As Object

Public Sub DO_AD_TREEBUILD(OBJ_TREEVIEW As Object, OBJ_IMAGELIST As


Object,
STR_AD_REFERENCE As String, BOL_VIEW_DEFAULTCONTAINERS As Boolean,
BOL_VIEW_OUS As Boolean, BOL_VIEW_USERS As Boolean, BOL_VIEW_GROUPS As
Boolean, BOL_VIEW_COMPUTERS As Boolean, BOL_VIEW_PRINTERS As Boolean,
BOL_VIEW_SHARES As Boolean, BOL_VIEW_TYPE As Boolean)



'========================================================================== > ========== > ' OBJ_TREEVIEW = Objet TreeView dans lequel construire la vue
' OBJ_IMAGELIST = Objet Imagelist de référence pour les images
' P1 > STR_AD_REFERENCE = chemin LDAP ( Conteneur ) qui sert de


point
de départ
' P2 > BOL_VIEW_DEFAULTCONTAINERS = Visibilité des conteneurs par défaut


AD
' P3 > BOL_VIEW_OUS = Visibilité des UOs
' P4 > BOL_VIEW_USERS = Visibilité des Utilisateurs
' P5 > BOL_VIEW_GROUPS = Visibilité des Groupes
' P6 > BOL_VIEW_COMPUTERS = Visibilité des Ordinateurs
' P7 > BOL_VIEW_PRINTERS = Visibilité des Imprimantes
' P8 > BOL_VIEW_SHARES = Visibilité des Partages
' P9 > BOL_VIEW_TYPE = Type de vue utilisée ( True=Arbre,
False=Plane )



'========================================================================== > ========== >
P1 = STR_AD_REFERENCE
P2 = True
P3 = True
P4 = BOL_VIEW_USERS
P5 = BOL_VIEW_GROUPS
P6 = BOL_VIEW_COMPUTERS
P7 = BOL_VIEW_PRINTERS
P8 = BOL_VIEW_SHARES
P9 = BOL_VIEW_TYPE

OBJ_TREEVIEW.Nodes.Clear
OBJ_TREEVIEW.ImageList = OBJ_IMAGELIST
Set OBJ_AD_REFERENCE = GetObject(STR_AD_REFERENCE)

If P9 = True Then
Set OBJ_NODE = OBJ_TREEVIEW.Nodes.Add(, ,


OBJ_AD_REFERENCE.ADsPath,
Mid(OBJ_AD_REFERENCE.Name, 4), 1)
OBJ_NODE.Expanded = True
End If

Call DO_RECURSE_TREE(OBJ_TREEVIEW, OBJ_AD_REFERENCE)

End Sub

Private Sub DO_RECURSE_TREE(OBJ_TREEVIEW As Object, ByVal OBJ_TEMP_PARENT


As
Object)



'========================================================================== > ========= > ' BOUCLE RECURSIVE PARENT/ENFANT OBJETS ADS



'========================================================================== > ========= > For Each OBJ_TEMP In OBJ_TEMP_PARENT

Call DO_ADD_NODE(OBJ_TREEVIEW, OBJ_TEMP_PARENT, OBJ_TEMP)
If FUN_IS_CONTAINER(OBJ_TEMP) = True Then Call
DO_RECURSE_TREE(OBJ_TREEVIEW, OBJ_TEMP)

Next

End Sub

Private Sub DO_ADD_NODE(OBJ_TREEVIEW As Object, OBJ_TEMP_PARENT As Object,
OBJ_TEMP As Object)



'========================================================================== > ========= > ' AJOUTE UN NOEUD ENFANT



'========================================================================== > ========= > If FUN_IS_VISIBLE(OBJ_TEMP) = False Then Exit Sub

If P9 = True Then Set OBJ_NODE > OBJ_TREEVIEW.Nodes.Add(OBJ_TEMP_PARENT.ADsPath, tvwChild,


OBJ_TEMP.ADsPath,
Mid(OBJ_TEMP.Name, 4), FUN_OBJECT_ICON(OBJ_TEMP))
If P9 = False And FUN_IS_CONTAINER(OBJ_TEMP) = False And
FUN_OBJECT_ICON(OBJ_TEMP) <> 9 Then Set OBJ_NODE OBJ_TREEVIEW.Nodes.Add(,
, OBJ_TEMP.ADsPath, Mid(OBJ_TEMP.Name, 4), FUN_OBJECT_ICON(OBJ_TEMP))

End Sub

Private Function FUN_OBJECT_ICON(OBJ_OBJECT_ICON As Object)



'========================================================================== > ========= > ' FONCTION POUR RETROUNER L'ICONE D'UN OBJET



'========================================================================== > ========= > FUN_OBJECT_ICON = 9
If FUN_IS_CONTAINER(OBJ_OBJECT_ICON) = True And OBJ_OBJECT_ICON.Class


<>
"organizationalUnit" Then FUN_OBJECT_ICON = 2
If OBJ_OBJECT_ICON.Class = "organizationalUnit" Then FUN_OBJECT_ICON 3
If OBJ_OBJECT_ICON.Class = "user" Then FUN_OBJECT_ICON = 4
If OBJ_OBJECT_ICON.Class = "group" Then FUN_OBJECT_ICON = 5
If OBJ_OBJECT_ICON.Class = "computer" Then FUN_OBJECT_ICON = 6
If OBJ_OBJECT_ICON.Class = "printer" Then FUN_OBJECT_ICON = 7
If OBJ_OBJECT_ICON.Class = "volume" Then FUN_OBJECT_ICON = 8

End Function

Private Function FUN_IS_CONTAINER(OBJ_IS_CONTAINER As Object)



'========================================================================== > ========= > ' FONCTION DE DEFINITION D'UN CONTENEUR



'========================================================================== > ========= > FUN_IS_CONTAINER = False

If OBJ_IS_CONTAINER.Class = "builtinDomain" Then FUN_IS_CONTAINER True
If OBJ_IS_CONTAINER.Class = "container" Then FUN_IS_CONTAINER = True
If OBJ_IS_CONTAINER.Class = "lostAndFound" Then FUN_IS_CONTAINER True
If OBJ_IS_CONTAINER.Class = "organizationalUnit" Then FUN_IS_CONTAINER


> True
If OBJ_IS_CONTAINER.Class = "domainPolicy" Then FUN_IS_CONTAINER True
If OBJ_IS_CONTAINER.Class = "dfsConfiguration" Then FUN_IS_CONTAINER > True
If OBJ_IS_CONTAINER.Class = "nTFRSSettings" Then FUN_IS_CONTAINER True
If OBJ_IS_CONTAINER.Class = "nTFRSReplicaSet" Then FUN_IS_CONTAINER > True
If OBJ_IS_CONTAINER.Class = "fileLinkTracking" Then FUN_IS_CONTAINER > True
If OBJ_IS_CONTAINER.Class = "rpcContainer" Then FUN_IS_CONTAINER True
If OBJ_IS_CONTAINER.Class = "linkTrackVolumeTable" Then


FUN_IS_CONTAINER
= True
If OBJ_IS_CONTAINER.Class = "groupPolicyContainer" Then


FUN_IS_CONTAINER
= True

End Function

Private Function FUN_IS_VISIBLE(OBJ_IS_VISIBLE As Object)



'========================================================================== > ========= > ' FONCTION DE DEFINITION DE LA VISIBILITE D'UN OBJET



'========================================================================== > ========= > FUN_IS_VISIBLE = True
If OBJ_IS_VISIBLE.Class = "user" And P4 = False Then FUN_IS_VISIBLE > False
If OBJ_IS_VISIBLE.Class = "group" And P5 = False Then FUN_IS_VISIBLE > False
If OBJ_IS_VISIBLE.Class = "computer" And P6 = False Then


FUN_IS_VISIBLE
= False
If OBJ_IS_VISIBLE.Class = "printer" And P7 = False Then FUN_IS_VISIBLE


> False
If OBJ_IS_VISIBLE.Class = "volume" And P8 = False Then FUN_IS_VISIBLE


> False
End Function

Private Sub Form_Load()
Call DO_AD_TREEBUILD(TreeView1, ImageList1, "LBLBLT", True, True,


True,
True, True, True, False, False)
End Sub




Publicité
Poster une réponse
Anonyme