scripts: redirection et profils windows 7 et 8

  • Olivier HUMBERT
  • Auteur du sujet
  • Hors Ligne
  • Membre senior
  • Membre senior
Plus d'informations
il y a 11 ans 3 mois - il y a 11 ans 3 mois #203 par Olivier HUMBERT
scripts: redirection et profils windows 7 et 8 a été créé par Olivier HUMBERT
bonjour
Code:
J'utilise ce script de : '-------------------------------------------------------------------------------------------------------------------------- '(c) 2006-2012 KoXo Dev. Script VBS Professeurs '-------------------------------------------------------------------------------------------------------------------------- '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 "Q:","\\PEDAGOGIQUE-002\Master$","Ma discipline [Master]" ConnectDrive "R:","\\PEDAGOGIQUE-002\Eleves$","Espaces personnels des élèves" ConnectDrive "S:","\\PEDAGOGIQUE-002\Classes$","Espaces communs des classes" 'Remove next quote to manage printers with a simple text file in netlogon Execute GetLogonServer+"\NETLOGON\Printers.vbs \\PEDAGOGIQUE-002\NETLOGON\Printers.txt" 'Remove next quote to display user and computer informations on the wallpaper Execute GetLogonServer+"\NETLOGON\Wallpapernoidpict.vbs /wallpaper=\\PEDAGOGIQUE-002\NETLOGON\fond\fond.bmp ;BackgroundColor=#808080" 'Remove next quote to cree icone bureau Execute "\\pedagogique-002\applis$\script\allusers.exe" 'Remove next quote to cree icone bureau profs Execute "\\pedagogique-002\applis$\script\profs.exe" 'Remove next quote to install et configure italc2 Execute "\\pedagogique-002\applis$\script\italc2.exe" 'End WScript.Quit '-------------------------------------------------------------------------------------------------------------------------- '/////////// '// Execute function execute(CommandLine) On Error Resume Next Dim oShell Set oShell=CreateObject("WScript.Shell") err.Number=0 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 '//////////////// '// Redirections function Redirections(Drive) On Error Resume Next Dim oShell Dim Reg,Personnal,Favorites,Templates,History,AppData,Cookies,ExcludeProfileDirs Set oShell=CreateObject("WScript.Shell") Personnal="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\Personal" Reg=oShell.RegWrite(Personnal,Drive+"\Mes documents","REG_SZ") Favorites="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\Favorites" Reg=oShell.RegWrite(Favorites,Drive+"\CONFIG\Favoris","REG_SZ") Templates="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\Templates" Reg=oShell.RegWrite(Templates,Drive+"\CONFIG\Modeles","REG_SZ") History="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\History" Reg=oShell.RegWrite(History,Drive+"\CONFIG\Historique","REG_SZ") AppData="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\AppData" Reg=oShell.RegWrite(AppData,Drive+"\CONFIG\Application Data","REG_SZ") Cookies="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\Cookies" Reg=oShell.RegWrite(Cookies,Drive+"\CONFIG\Cookies","REG_SZ") ExcludeProfileDirs="HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System\ExcludeProfileDirs" Reg=oShell.RegWrite(ExcludeProfileDirs,"Mes Documents;Favoris;Bureau;Menu démarrer;Application Data;Cookies;Modèles","REG_SZ") 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.number=0 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

avec win xp cela exclu bien les dossiers Mes Documents;Favoris;Bureau;Menu démarrer;Application Data;Cookies;Modèles et la redirection vers config du application data favoris,etc....

par contre pour windows 7 et 8

Mes profils V2 sur le lecteur p: , ses dossiers ne sont pas exclu et je ne suis pas sure que le appdata va sur CONFIG.Du coup mes profil v2 sont très lourd puisqu'il comporte le bureau ,les téléchargement etc..

a mon avis ses script ne sont pas optimisé pour windows 7 et 8.
Il y as t'il des scripts plus récent ou alors faut il utiliser les gpo???

De plus sur windows 7 ou 8 , j'ai un message pour la bibliothèque documents emplacement p:\mes documents et non pris en charge.Il disent qu'il faut que cela soit un emplacement synchroniser mais si je fait cela j'ai peur que mon serveur soit vite sature en espace disque.

De plus j'ai un autre soucis pour certaines installations (java par exemple ou office 2007) les installs ne vont pas jusqu'au bout et il y a un message lecteur p: non valide.
Je me suis donc crée un utilisateur admin mais que n'est pas itinérant et qui n'as pas de P: non plus.

J’espère être assez explicite mais j'ai quand même l'impression que ses scripts ne sont pas optimale pour la gestion des redirections et du profil il ont l'air de faire leur boulot mais je suis pas sur que win7 et 8 aprécie cette méthode.

Si des utilisateurs ou le support pouvait me donner leur sentiment ou leur expérience sur win 7 et/ou 8 se serait sympas.
Dernière édition: il y a 11 ans 3 mois par Olivier HUMBERT.

Connexion ou Créer un compte pour participer à la conversation.

Temps de génération de la page : 0.406 secondes