1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213
| On Error resume next
Dim WSHShell, WSHNetwork, objDomain, DomainString, UserString, UserObj, Path, sTime, sDate, UserGroups, GroupObj
set WshShell = CreateObject("WScript.Shell")
Set WshNetwork = WScript.CreateObject("WScript.Network")
DomainString = Wshnetwork.UserDomain
UserString = WSHNetwork.UserName
Set oShell = CreateObject("Shell.Application")
Set UserObj = GetObject("WinNT://" & DomainString & "/" & UserString)
Set oDrives = WshNetwork.EnumNetworkDrives
strComputer = WSHNetwork.ComputerName
Function InGroup(strGroup)
InGroup=False
If InStr(UserGroups,"[" & strGroup & "]") Then
InGroup=True
End If
End Function
For Each GroupObj In UserObj.Groups
UserGroups=UserGroups & "[" & GroupObj.Name & "]"
Next
'Deconnexion de tout les lecteurs reseaux
'WshShell.Run "NET USE * /delete /Y"
For intDrive = 0 To oDrives.Count - 1 Step 2
If oDrives.Item(intDrive) <> "" Then
WshNetwork.RemoveNetworkDrive oDrives.Item(intDrive) , true, true
Else
WshNetwork.RemoveNetworkDrive oDrives.Item(intDrive+1) , true, true
End if
Next
'Lecteur par default
WshNetwork.MapNetworkDrive "X:","\\bfasrv4.bfa.intra\id200", True
oShell.NameSpace("X:\").Self.Name = "ID200"
WshNetwork.MapNetworkDrive "P:","\\bfa-fil1.bfa.intra\Prive\" & wshNetwork.Username, False
oShell.NameSpace("P:\").Self.Name = "PRIVE"
'--------------------------------
' Lecteurs des administrateurs |
'--------------------------------
if InGroup("Admins du domaine") then
WshNetwork.MapNetworkDrive "K:","\\yoda.sovex.intra\kiosque", True
oShell.NameSpace("K:\").Self.Name = "KIOSQUE"
WshNetwork.MapNetworkDrive "M:","\\bourvil.sovex.intra\Marketing", True
oShell.NameSpace("M:\").Self.Name = "MARKETING"
WshNetwork.MapNetworkDrive "N:","\\sovexdata.sovex.intra\public", True
oShell.NameSpace("N:\").Self.Name = "PUBLIC-SOVEX"
WshNetwork.MapNetworkDrive "U:","\\bfa-fil1.bfa.intra\bm\travail", True
oShell.NameSpace("U:\").Self.Name = "TRAVAIL-BM"
WshNetwork.MapNetworkDrive "O:","\\yoda.sovex.intra\id200", True
oShell.NameSpace("O:\").Self.Name = "ID200_SOVEX"
end if
'Lecteurs du groupe DOC_INFO
if InGroup("DOC_INFO") then
WshNetwork.MapNetworkDrive "I:","\\bfa-fil1.bfa.intra\doc-info", True
oShell.NameSpace("I:\").Self.Name = "DOC-INFO"
end if
'Lecteurs du groupe BFA
if InGroup("BFA") then
WshNetwork.MapNetworkDrive "T:","\\bfa-fil1.bfa.intra\bfa\public", True
oShell.NameSpace("T:\").Self.Name = "PUBLIC-BFA"
end if
'Lecteur du groupe BM
if InGroup("Ballande&Meneret") then
WshNetwork.MapNetworkDrive "T:","\\bfa-fil1.bfa.intra\bm\travail", True
oShell.NameSpace("T:\").Self.Name = "TRAVAIL-BM"
end if
'LCB
If Ingroup ("LCB Logistique") then
WshNetwork.MapNetworkDrive "I:","\\bfasrv4.bfa.intra\iDGamma\DTI+", True
oShell.NameSpace("I:\").Self.Name = "DTI+"
end if
'Lecteur du groupe de la comptabilité
if InGroup("Compta BFA") then
WshNetwork.MapNetworkDrive "S:","\\supertramp.bfa.intra\sage", True
oShell.NameSpace("S:\").Self.Name = "SAGE"
WshNetwork.MapNetworkDrive "Y:","\\supertramp.bfa.intra\sage\documents standard", True
oShell.NameSpace("Y:\").Self.Name = "DOCUMENTS STANDARD"
end if
'Lecteurs du groupe EX-VITIS
if InGroup("EX-VITIS") then
WSHNetwork.RemoveNetworkDrive "T:", True, True
WshNetwork.MapNetworkDrive "V:","\\bfa-fil1.bfa.intra\VPC", True
oShell.NameSpace("V:\").Self.Name = "VPC"
WshNetwork.MapNetworkDrive "M:","\\bfa-fil1.bfa.intra\BM\Travail", True
oShell.NameSpace("M:\").Self.Name = "TRAVAIL-BM"
WshNetwork.MapNetworkDrive "T:","\\bfa-fil1.bfa.intra\BFA\public", True
oShell.NameSpace("T:\").Self.Name = "PUBLIC-BFA"
If WshNetwork.Username = "henriotst" then
WSHNetwork.RemoveNetworkDrive "V:", True, True
end if
end if
'RETAIL
if Ingroup("Retail") then
WshNetwork.MapNetworkDrive "R:","\\bfa-fil1.bfa.intra\retail", True
oShell.NameSpace("R:\").Self.Name = "RETAIL"
end if
'Non-ID200
if Ingroup("Non-ID200") then
WSHNetwork.RemoveNetworkDrive "X:", True, True
End If
'Chateau Prieuré Lichine
if Ingroup("Chateau Prieure LICHINE") then
WshNetwork.MapNetworkDrive "T:","\\bfa-fil1.bfa.intra\PRIEURE", True
oShell.NameSpace("T:\").Self.Name = "PRIEURE_BFA"
WshNetwork.MapNetworkDrive "M:","\\cplsrv3.prieure.intra\PRIEURE", True
oShell.NameSpace("M:\").Self.Name = "PUBLIC_PRIEURE"
end if
'ID200-SOVEX
if Ingroup("ID200-SOVEX") then
WshNetwork.MapNetworkDrive "O:","\\yoda.sovex.intra\id200", True
oShell.NameSpace("O:\").Self.Name = "ID200-SOVEX"
end if
'My report
if Ingroup("My-REPORT") then
WshNetwork.MapNetworkDrive "Z:","\\supertramp.bfa.intra\MySystem BALLANDE", True
oShell.NameSpace("Z:\").Self.Name = "MY REPORT"
End if
'-------------------
'| Cas particulier |
'-------------------
'------------------
'| Arnaud NANDRIN |
'------------------
If WshNetwork.Username = "nandrinar" then
WshNetwork.MapNetworkDrive "T:","\\bfa-fil1.bfa.intra\bm\travail", True
oShell.NameSpace("T:\").Self.Name = "TRAVAIL-BM"
WshNetwork.MapNetworkDrive "Y:","\\bfa-fil1.bfa.intra\BFA\public", True
oShell.NameSpace("Y:\").Self.Name = "PUBLIC-BFA"
WshNetwork.MapNetworkDrive "I:","\\bfasrv4.bfa.intra\iDGamma", True
oShell.NameSpace("I:\").Self.Name = "IDGAMMA"
WshNetwork.MapNetworkDrive "S:","\\sovexdata.sovex.intra\public" , True
oShell.NameSpace("S:\").Self.Name = "PUBLIC-SOVEX"
end if
'-------------------------------------
'| Client BFA200 pour Sandrine DULAS |
'-------------------------------------
If WshNetwork.Username = "dulassa" then
WshNetwork.MapNetworkDrive "V:","\\radiohead.bfa.intra\client", True
oShell.NameSpace("V:\").Self.Name = "CLIENT-BFA200"
end if
'------------------------------------
' Partage de compta BFA et prieure |
'------------------------------------
if InGroup("compta_prieure") then
WshNetwork.MapNetworkDrive "W:","\\bfa-fil1.bfa.intra\prieure", True
oShell.NameSpace("W:\").Self.Name = "COMPTA_PRIEURE"
end if
'-----------------
' acces a ID150 |
'-----------------
if InGroup("ID150") then
WshNetwork.MapNetworkDrive "Z:","\\bfa-fil1.bfa.intra\bfa", True
oShell.NameSpace("Z:\").Self.Name = "ID150"
end if
'------------------
' Philippe GODIN |
'------------------
If WshNetwork.Username = "godinph" then
WshNetwork.MapNetworkDrive "N:","\\bfa-fil1.bfa.intra\PRIEURE", True
oShell.NameSpace("N:\").Self.Name = "PRIEURE"
WshNetwork.MapNetworkDrive "M:","\\bfa-fil1.bfa.intra\Travail-BM", True
oShell.NameSpace("M:\").Self.Name = "TRAVAIL-BM"
end if
'----------------------
' Alexandre de GANAY |
'----------------------
If WshNetwork.Username = "deganayal" then
WshNetwork.MapNetworkDrive "Y:","\\bfa-fil1.bfa.intra\sources", True
oShell.NameSpace("Y:\").Self.Name = "SOURCES"
WshNetwork.MapNetworkDrive "Z:","\\BFA.INTRA\NETLOGON", True
oShell.NameSpace("Z:\").Self.Name = "NETLOGON_BFA"
WshNetwork.MapNetworkDrive "W:","\\SOVEX.INTRA\NETLOGON", True
oShell.NameSpace("W:\").Self.Name = "NETLOGON_SOVEX"
end if
'------------------
' PASCAL BROUET |
'------------------
If WshNetwork.Username = "brouetpa" then
WshNetwork.MapNetworkDrive "L:","\\bfa-fil1.bfa.intra\bfa\Public\Partage LCB Pascal - Beatrice", True
oShell.NameSpace("L:\").Self.Name = "LCB PASCAL - BEATRICE"
end if
'-------------------
' Chantal DU PATY |
'-------------------
If WshNetwork.Username = "dupatych" then
WshNetwork.MapNetworkDrive "S:","\\bfa-fil1.bfa.intra\bfa\public", True
oShell.NameSpace("S:\").Self.Name = "PUBLIC-BFA"
end if |
Partager