Bonjour.
Voila mon code voir en dessous pour ce que je veux faire :
On Error Resume Next
Set objSysInfo = CreateObject("ADSystemInfo" )
Set objNetwork = CreateObject("Wscript.Network" )
strUserPath = "LDAP://" & objSysInfo.UserName
'strRemotePath = "\\" & Computername & "\C$\subst"
Set objUser = GetObject(strUserPath)
objNetwork.MapNetworkDrive "Z:", "\\abp-cdi-svr-f01\User Folder\%username%"
For Each strGroup in objUser.MemberOf
strGroupPath = "LDAP://" & strGroup
Set objGroup = GetObject(strGroupPath)
strGroupName = objGroup.CN
Select Case strGroupName
Case "information technology"
objNetwork.MapNetworkDrive "W:", "\\abp-cdi-svr-f01\Departmental Folder\Information Technology"
Case "Recovery Service"
objNetwork.MapNetworkDrive "W:", "\\abp-cdi-svr-f01\Departmental Folder\Recovery Service"
Case "Adzope Branch"
objNetwork.MapNetworkDrive "W:", "\\abp-cdi-svr-f01\Departmental Folder\Adzope Branch"
Case "Commercial banking"
objNetwork.MapNetworkDrive "W:", "\\abp-cdi-svr-f01\Departmental Folder\Commercial banking"
Case "Corporate banking"
objNetwork.MapNetworkDrive "W:", "\\abp-cdi-svr-f01\Departmental Folder\Corporate Banking"
Case "Customer Service"
objNetwork.MapNetworkDrive "W:", "\\abp-cdi-svr-f01\Departmental Folder\Customer Service"
Case "Financial Service"
objNetwork.MapNetworkDrive "W:", "\\abp-cdi-svr-f01\Departmental Folder\Financial Service"
Case "General Service"
objNetwork.MapNetworkDrive "W:", "\\abp-cdi-svr-f01\Departmental Folder\General Service"
Case "Hayat Branch"
objNetwork.MapNetworkDrive "W:", "\\abp-cdi-svr-f01\Departmental Folder\Hayet Branch"
Case "Human resources"
objNetwork.MapNetworkDrive "W:", "\\abp-cdi-svr-f01\Departmental Folder\Human resources"
Case "Compliance Internal Control"
objNetwork.MapNetworkDrive "W:", "\\abp-cdi-svr-f01\Departmental Folder\Compliance Internal Control"
Case "Legal"
objNetwork.MapNetworkDrive "W:", "\\abp-cdi-svr-f01\Departmental Folder\Legal"
Case "Operation Unit"
objNetwork.MapNetworkDrive "W:", "\\abp-cdi-svr-f01\Departmental Folder\Operation unit"
Case "Prima Branch"
objNetwork.MapNetworkDrive "W:", "\\abp-cdi-svr-f01\Departmental Folder\Prima Branch"
Case "Retail Banking"
objNetwork.MapNetworkDrive "W:", "\\abp-cdi-svr-f01\Departmental Folder\Retail Banking"
Case "Risk Management"
objNetwork.MapNetworkDrive "W:", "\\abp-cdi-svr-f01\Departmental Folder\Risk management"
Case "Roiser Branch"
objNetwork.MapNetworkDrive "W:", "\\abp-cdi-svr-f01\Departmental Folder\Roiser Branch"
Case "Treasury"
objNetwork.MapNetworkDrive "W:", "\\abp-cdi-svr-f01\Departmental Folder\Treasury"
Case "allcotedivoireusers"
objNetwork.MapNetworkDrive "W:", "\\abp-cdi-svr-f01\Departmental Folder\General Share Folder"
End Select
Next
En fait j'ai éditer ce script dans un policy sur Active directory à chaque logon de l'utilisateur. Le problème c'est que ça ne fonctionne pas.
SVP pourriez-vous m'aider?