You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2021-08-09 17:04:35

lee
Member
Registered: 2007-01-31
Posts: 562

Nouvelle version pour fusion.vbs

Bonjour
J'ai mis a jour fusion.vbs pour qu'il aille chercher les parametres de l'agent directement sur le http://location ainsi que l'agent executable
Ce qui me permet de mettre au demarrage sur les postes et surtout les portables en télétravail un script pour installer ou mettre à jour l'agent .
Pour information les postes en teletravail ne sont pas rattachés à un active directory donc au demarrage on ne peut pas lancer le script GPO ni
sur l'ordinateur ni  sur l'utilisateur
Sur l'espace de Setuplocation http://location se trouve donc le fichier fusioninventory-windows_agent.cfg et les 2 executables 32 et 64 (exe)



Contenu du fichier  fusioninventory-windows_agent.cfg
# Variables par Ligne 1: Version  Ligne 2 : Force  Ligne 3 : VerBose (ne pas supprimer
cette ligne)
2.6.0
No
Yes

Contenuu du fichier fusion.vbs modifié juste apres MAIN ..
'
'  ------------------------------------------------------------------------
'  fusioninventory-agent-deployment.vbs
'  Copyright (C) 2010-2013 by the FusionInventory Development Team.
'
http://www.fusioninventory.org/ http://forge.fusioninventory.org/
'  ------------------------------------------------------------------------
'
'  LICENSE
'
'  This file is part of FusionInventory project.
'
'  This file is free software; you can redistribute it and/or modify it
'  under the terms of the GNU General Public License as published by the
'  Free Software Foundation; either version 2 of the License, or (at your
'  option) any later version.
'
'
'  This file is distributed in the hope that it will be useful, but WITHOUT
'  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
'  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
'  more details.
'
'  You should have received a copy of the GNU General Public License
'  along with this program; if not, write to the Free Software Foundation,
'  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA,
'  or see <http://www.gnu.org/licenses/>.
'
'  ------------------------------------------------------------------------
'
'  @package   FusionInventory Agent
'  @file      .\contrib\windows\fusioninventory-agent-deployment.vbs
'  @author(s) Benjamin Accary <meldrone@orange.fr>
'             Christophe Pujol <chpujol@gmail.com>
'             Marc Caissial <marc.caissial@zenitique.fr>
'             Tomas Abad <tabadgp@gmail.com>
'  @copyright Copyright (c) 2010-2013 FusionInventory Team
'  @license   GNU GPL version 2 or (at your option) any later version
'             http://www.gnu.org/licenses/old-license … alone.html
'  @link      http://www.fusioninventory.org/
'  @link      http://forge.fusioninventory.org/projec … tory-agent
'  @since     2012
'
'  ------------------------------------------------------------------------
'

'
'
' Purpose:
'     FusionInventory Agent Unatended Deployment.
'
'

' ******* DECLARATION DE LA VARIABLE Wsetup

Option Explicit
Dim Force, Verbose
Dim Setup, WSetup, SetupArchitecture, SetupLocation, SetupOptions, SetupVersion

'
'
' USER SETTINGS
'
'

' SetupLocation
'    Depending on your needs or your environment, you can use either a HTTP or
'    CIFS/SMB.
'
'    If you use HTTP, please, set to SetupLocation a URL:
'
'       SetupLocation = "http://host[:port]/[absolut_path]" or
'       SetupLocation = "https://host[:port]/[absolut_path]"
'
'    If you use CIFS, please, set to SetupLocation a UNC path name:
'
'       SetupLocation = "\\host\share\[path]"
'
'       You also must be sure that you have removed the "Open File Security Warning"
'       from programs accessed from that UNC.
'
' ***** POSITIONNEMENT SetupLocation sur

SetupLocation = "https://location"

'    The installer file name. You should not have to modify this variable ever.
'
Setup = "fusioninventory-agent_windows-" & SetupArchitecture & "_" & SetupVersion & ".exe"
WSetup = "fusioninventory-agent_windows.cfg"

'
'
' MAIN
'
'

Dim nMinutesToAdvance, strCmd, strSystemArchitecture, strTempDir, WshShell, StrApp, StrDel
Set WshShell = WScript.CreateObject("WScript.shell")

' ******* Ajout de declaration de Variable ******
Dim fs, f, ts, s,Commentaire

nMinutesToAdvance = 5


' **** RECUPERATION DES VALEURS POUR LES PARAMETRES SetupVersion , Force et Verbose à partir de Wsetup
'If isHttp(SetupLocation) Then
    ShowMessage("downloading Config'" & SetupLocation & "/" & WSetup & "'!")
    If SaveWebBinary(SetupLocation, WSetup) Then
     
        Set fs = CreateObject("Scripting.FileSystemObject")
        strCmd = WshShell.ExpandEnvironmentStrings("%ComSpec%")
        strTempDir = WshShell.ExpandEnvironmentStrings("%TEMP%")
       
        ShowMessage("Fichier: """ & strTempDir & "\" & WSetup & """ ")
        Set f = fs.GetFile(""& strTempDir & "\" & WSetup & "")
        Set ts = f.OpenAsTextStream(1, -2)
        Commentaire = ts.ReadLine
       
        SetupVersion = ts.ReadLine
        ShowMessage("SetupVersion: " & SetupVersion )
        Force=ts.ReadLine
        ShowMessage("Force: " & Force )
        Verbose=ts.ReadLine
        ShowMessage("Verbose: " & Verbose )
        Setup = "fusioninventory-agent_windows-" & SetupArchitecture & "_" & SetupVersion & ".exe"
        ShowMessage("Setup: " & Setup )
        ts.Close
    Else
        ShowMessage("Error downloading '" & SetupLocation & "/" & WSetup & "'!")
        WScript.Quit 1
    End If
'End If


Merci

GLPI 10.0.11/ Plugins GlpiInventory  / AgentGlpi : 1.5  < Serveur Debian 64 Bits>

Offline

#2 2022-02-20 18:21:15

lee
Member
Registered: 2007-01-31
Posts: 562

Re: Nouvelle version pour fusion.vbs

L'avantage c'est que je ne passe plus sur tous les AD de mes sites pour modifier la version , "force ou pas" et verbose
c'est sur le meme serveur que https://location


Merci

GLPI 10.0.11/ Plugins GlpiInventory  / AgentGlpi : 1.5  < Serveur Debian 64 Bits>

Offline

#3 2022-04-09 20:18:22

lee
Member
Registered: 2007-01-31
Posts: 562

Re: Nouvelle version pour fusion.vbs

Bonjour

L'avantage de mettre les parametres aussi sur un http
(on ne modifie qu'une seule fois ... pas sur tous les AD si on en a beaucoup ..)

Pour les postes en nomades qui ne passent pas par l'AD
il y a bien dans la base de regsitre du demarrage du poste un executable de fusion.vbs
et la config et le changement de version sera recupére sur le setuplocation
sinon il faut pouvoir modifier sur chaque poste en nomade les parametres dans fusion.vbs


Merci

GLPI 10.0.11/ Plugins GlpiInventory  / AgentGlpi : 1.5  < Serveur Debian 64 Bits>

Offline

#4 2022-04-16 10:12:39

lee
Member
Registered: 2007-01-31
Posts: 562

Re: Nouvelle version pour fusion.vbs

Bonjour

J'ai aussi forcé une desinstallation avec une pause avant de relancer l'installation
car les machines etant "rapides" le script vbs retrouve une clé dans la base de registre
et l'installation en se fait pas

Je ferai la meme chose pour le nouvel AGENT


Merci

GLPI 10.0.11/ Plugins GlpiInventory  / AgentGlpi : 1.5  < Serveur Debian 64 Bits>

Offline

Board footer

Powered by FluxBB