Bonjour,
Je me demande si le script d'ouverture de session n'est pas en cause
Le script suivant est basé sur le modèle Professeur4.vbs
En parcourant le forum il y a une ligne que je n'ai pas : (en rouge)
Pour que la GPO s'applique, il n'y aurait pas une modification à faire sur le script ?
Merci pour votre aide
<code>'
'(c) 2006-2015 KoXo Dev. Script VBS "Professeurs 4"
'
'Unmap existing drives
UnconnDrives
Set UserObj=FindUser
If Not IsEmpty(UserObj) Then
'Map Home Drive
ConnectDrive UserObj.HomeDirDrive,UserObj.HomeDirectory,"Espace personnel de "+UserObj.fullName
'Folders redirection (remove next line if managed with GPO)
'Redirections UserObj.HomeDirDrive
End If
'Map Group Drives
ConnectDrive "%GROUP_DRIVE%","\\%SECONDARY_GROUP_SERVER%\%SECONDARY_GROUP%$","Ma discipline [%SECONDARY_GROUP%]"
ConnectDrive "R:","\\%SERVER[1]%\Eleves$","Espaces personnels des élèves"
ConnectDrive "S:","\\%SERVER[1]%\Classes$","Espaces communs des classes"</code>
*************************
Script actuel utilisés
<code>'
'(c) 2006-2015 KoXo Dev. Script VBS "Professeurs 4"
'
'Unmap existing drives
UnconnDrives
Set UserObj=FindUser
If Not IsEmpty(UserObj) Then
'Map Home Drive
ConnectDrive UserObj.HomeDirDrive,UserObj.HomeDirectory,"Espace personnel de "+UserObj.fullName
End If
'Map Group Drives
ConnectDrive "Q:","\\PEDAGO-NAS1\Maths$","Ma discipline [Maths]"
'ConnectDrive "R:","\\PEDAGO-AD1\Eleves$","Espaces personnels des élèves"
ConnectDrive "S:","\\PEDAGO-NAS1\Classes$","Espaces communs des classes"
'Remove next quote to display user and computer informations on the wallpaper
Execute GetLogonServer+"\NETLOGON\Wallpaper.vbs /BackGroundColor=#808080"
'End
WScript.Quit
'
'///////////
'// Execute
function execute(CommandLine)
On Error Resume Next
Dim oShell
Set oShell=CreateObject("WScript.Shell")
Err.Clear
oShell.Run CommandLine,1,True
If Err.Number<>0 Then
oShell.Popup "Execution : " & CommandLine & VbCrLf & "Description=" & Err.Description & VbCrLf & "Code=" & Err.Number,5,"Erreur",64
End If
end function
'////////////////////////////////
'// Unconnect all network drives
function UnconnDrives()
On Error Resume Next
Dim objNetwork
Dim i,colDrives
Set objNetwork=WScript.CreateObject("WScript.Network")
'Unmap existing drives
Set colDrives=objNetwork.EnumNetworkDrives
If colDrives.Count<>0 Then
For i=0 To colDrives.Count-1 Step 2
objNetwork.RemoveNetworkDrive colDrives(i),"True","True"
Next
End If
End function
'/////////////////////
'// Find a user in AD
function FindUser()
On Error Resume Next
Dim objNetwork,oScriptShell
Dim strUserName,strUserDomain,sUserObj
Dim i,UserObj
Set objNetwork=WScript.CreateObject("WScript.Network")
Set oScriptShell=CreateObject("WScript.Shell")
strUserName=objNetwork.UserName
strUserDomain=objNetwork.UserDomain
sUserObj="WinNT://" & strUserDomain & "/" & strUserName
i=0
Do
i=i+1
Set UserObj=GetObject(sUserObj)
If UserObj Is Nothing Then WScript.Sleep 1000 End If
Loop While (i<20) And IsEmpty(UserObj)
If UserObj Is Nothing Then
oScriptShell.Popup "Impossible de trouver : " & sUserObj,5,"Erreur GetObject",64
End If
Set FindUser=UserObj
End function
'///////////////////
'// Connect a drive
function ConnectDrive(Drive,Path,Description)
On Error Resume Next
Dim objNetwork,oScriptShell
Set objNetwork=WScript.CreateObject("WScript.Network")
Set oScriptShell=CreateObject("WScript.Shell")
Set oShell=CreateObject("Shell.Application")
Err.Clear
objNetwork.MapNetworkDrive Drive,Path
If Err.Number<>0 Then
oScriptShell.Popup "Connexion lecteur " & Drive & " (" & Path & ")" & VbCrLf & "Description=" & Err.Description & VbCrLf & "Code=" & Err.Number,5,"Erreur",64
Else
oShell.NameSpace(Drive).Self.Name=Description
End If
end function
'//////////////////////
'// Get the LogonServer
function GetLogonServer()
Dim objShell
Set objShell=Wscript.CreateObject("Wscript.Shell")
GetLogonServer=objShell.ExpandEnvironmentStrings("%LOGONSERVER%")
End Function</code>