Meilleur auteur de réponses
Installation d'un msi + un exe par script de démarrage via gpo

Question
-
Bonjour,
Je suis en train de déployer un client juniper par script de démarrage dans une gpo.
Mais lorsque l'ordinateur démarre l'installation ne se fait pas.
Pourtant le gpresult sur le poste me dit que la gpo est bien appliquée et lorsque je lance le script manuellement en tant qu'administrateur du domaine (AD 2003) le script fonctionne bien et l'installation s'effectue correctement.
Les packages à installer sont stocké sur un partage.
Les autorisations de partage sont full access pour le groupe domain users et domain admins et les autorisations de sécurité
sont lecture + execution pour le groupe domain users et full access pour le groupe domain admins.
Voici mon script:
--------------------------- debut -------------------------------------------------------
strComputer = "."Dim objFSO : Set objFSO = CreateObject("Scripting.FileSystemObject")
Dim objShell : Set objShell = CreateObject("WScript.Shell")
Dim MSILocation : MSILocation = "\\FS01\NCInstall$\JuniperSetupServiceInstaller.msi /qn"
DIM EXELocation : EXELocation = "\\FS01\NCInstall$\NCInst.exe"
Dim InstallFolder : InstallFolder = "Juniper Networks"Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colChassis = objWMIService.ExecQuery _
("Select * from Win32_SystemEnclosure")
For Each objChassis in colChassis
For Each strChassisType in objChassis.ChassisTypes
if ((strChassisType = 7) or (strChassisType = 6) or (strChassisType = 3)) thenWScript.Quit
Else
If Not objFSO.FolderExists(objShell.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\" & InstallFolder) Then
objShell.Run objShell.ExpandEnvironmentStrings("%WINDIR%") & "\System32\msiexec /a " & MSILocation
WScript.Sleep(12000)
objShell.Run objShell.ExpandEnvironmentStrings("%WINDIR%") & "\System32\cmd.exe /c" & EXELocation
Else
WScript.Quit
End If
End If
Next
Next
----------------------------------------Fin--------------------------------------------------------
Merci de votre aide
Lyesjeudi 3 décembre 2009 13:48
Réponses
-
Bonjour ,
Voir : http://support.microsoft.com/kb/816102/fr. Est-ce le paquet MSI est publié ?
Ici vous avez :
Les packages publiés sont affichés sur un ordinateur client après l'utilisation d'une stratégie de groupe pour les supprimer
Cette situation peut se produire lorsqu'un utilisateur a installé le programme, mais qu'il ne l'a pas utilisé. L'installation est finalisée lorsque l'utilisateur démarre le programme publié pour la première fois. Stratégie de groupe supprime ensuite le programme.
Voir aussi : http://social.technet.microsoft.com/Forums/en-US/configmgrsetup/thread/a0c8303b-9933-41fb-b3ea-60da0c7edfe2
http://www.windowsnetworking.com/articles_tutorials/Group-Policy-Deploy-Applications.html
Cordialement
Roxana Panait, MSFT- Marqué comme réponse msbeginer vendredi 4 décembre 2009 17:43
vendredi 4 décembre 2009 10:42 -
Bonjour,
Merci pour votre réponse.
J'ai réussi à faire tourner mon script.
Après recherche j'ai appris que si j'arrivai à installer l'executable j'avais pas besoin du MSI (car son install pose problème dès lors qu'il n'y a pas de session ouverte.
J'ai donc modifié mon script qui comportait quelques erreurs et maintenant ça fonctionne parfaitement.
En effet le script vbs lancait la tache d'install mais n'attendait pas la fin de l'installation du .exe pour s'arrêter et donc l'install n'aboutissait jamais.
Voiçi la version qui marche:
------------------------------------------------debut--------------------------------------------------------------
strComputer = "."Dim objFSO : Set objFSO = CreateObject("Scripting.FileSystemObject")
Dim objShell : Set objShell = CreateObject("WScript.Shell")
DIM EXELocation : EXELocation = "\\FS01\NCInstall$\NCInst.exe"
Dim InstallFolder1 : InstallFolder1 = "Juniper Networks"
Dim InstallFolder2 : InstallFolder2 = "Common Files"
Dim FileToCheck : FileToCheck = "dsNcService.exe"Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colChassis = objWMIService.ExecQuery _
("Select * from Win32_SystemEnclosure")
For Each objChassis in colChassis
For Each strChassisType in objChassis.ChassisTypes
if ((strChassisType = 7) or (strChassisType = 6) or (strChassisType = 3)) thenWScript.Quit
Else
If Not objFSO.FileExists(objShell.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\" & InstallFolder1 & "\" & InstallFolder2 & "\" & FileToCheck )
Then
objShell.Run objShell.ExpandEnvironmentStrings("%WINDIR%") & "\System32\cmd.exe /c start " & EXELocation
WScript.Sleep(60000)
Else
WScript.Quit
End If
End If
Next
Next
----------------------------------------------fin----------------------------------------------------------------
Merci pour votre aide
Lyes- Marqué comme réponse msbeginer vendredi 4 décembre 2009 17:43
vendredi 4 décembre 2009 17:43
Toutes les réponses
-
Bonjour ,
Voir : http://support.microsoft.com/kb/816102/fr. Est-ce le paquet MSI est publié ?
Ici vous avez :
Les packages publiés sont affichés sur un ordinateur client après l'utilisation d'une stratégie de groupe pour les supprimer
Cette situation peut se produire lorsqu'un utilisateur a installé le programme, mais qu'il ne l'a pas utilisé. L'installation est finalisée lorsque l'utilisateur démarre le programme publié pour la première fois. Stratégie de groupe supprime ensuite le programme.
Voir aussi : http://social.technet.microsoft.com/Forums/en-US/configmgrsetup/thread/a0c8303b-9933-41fb-b3ea-60da0c7edfe2
http://www.windowsnetworking.com/articles_tutorials/Group-Policy-Deploy-Applications.html
Cordialement
Roxana Panait, MSFT- Marqué comme réponse msbeginer vendredi 4 décembre 2009 17:43
vendredi 4 décembre 2009 10:42 -
Bonjour,
Merci pour votre réponse.
J'ai réussi à faire tourner mon script.
Après recherche j'ai appris que si j'arrivai à installer l'executable j'avais pas besoin du MSI (car son install pose problème dès lors qu'il n'y a pas de session ouverte.
J'ai donc modifié mon script qui comportait quelques erreurs et maintenant ça fonctionne parfaitement.
En effet le script vbs lancait la tache d'install mais n'attendait pas la fin de l'installation du .exe pour s'arrêter et donc l'install n'aboutissait jamais.
Voiçi la version qui marche:
------------------------------------------------debut--------------------------------------------------------------
strComputer = "."Dim objFSO : Set objFSO = CreateObject("Scripting.FileSystemObject")
Dim objShell : Set objShell = CreateObject("WScript.Shell")
DIM EXELocation : EXELocation = "\\FS01\NCInstall$\NCInst.exe"
Dim InstallFolder1 : InstallFolder1 = "Juniper Networks"
Dim InstallFolder2 : InstallFolder2 = "Common Files"
Dim FileToCheck : FileToCheck = "dsNcService.exe"Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colChassis = objWMIService.ExecQuery _
("Select * from Win32_SystemEnclosure")
For Each objChassis in colChassis
For Each strChassisType in objChassis.ChassisTypes
if ((strChassisType = 7) or (strChassisType = 6) or (strChassisType = 3)) thenWScript.Quit
Else
If Not objFSO.FileExists(objShell.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\" & InstallFolder1 & "\" & InstallFolder2 & "\" & FileToCheck )
Then
objShell.Run objShell.ExpandEnvironmentStrings("%WINDIR%") & "\System32\cmd.exe /c start " & EXELocation
WScript.Sleep(60000)
Else
WScript.Quit
End If
End If
Next
Next
----------------------------------------------fin----------------------------------------------------------------
Merci pour votre aide
Lyes- Marqué comme réponse msbeginer vendredi 4 décembre 2009 17:43
vendredi 4 décembre 2009 17:43