IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

VBScript Discussion :

Script VBS Update Sophos Endpoint Security and Control 11.0.13 UTM


Sujet :

VBScript

  1. #1
    Membre à l'essai
    Homme Profil pro
    Étudiant
    Inscrit en
    Janvier 2018
    Messages
    6
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 30
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Janvier 2018
    Messages : 6
    Points : 10
    Points
    10
    Par défaut Script VBS Update Sophos Endpoint Security and Control 11.0.13 UTM
    Bonjour à vous tous,
    nous souhaiterions automatiser la mise à jour de Sophos pour nos clients Windows 10, en vbscript si possible .
    Nous utilisons déjà des script pour automatiser plein de tâche dans notre infrastructure, nous sommes pas en compétence de créer le script de A à Z .
    Nous disposons de Sophos UTM 9 sur notre server .

    Je vous remercie .

    Cordialement .

  2. #2
    Expert éminent
    Avatar de hackoofr
    Homme Profil pro
    Enseignant
    Inscrit en
    Juin 2009
    Messages
    3 839
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 48
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Enseignant

    Informations forums :
    Inscription : Juin 2009
    Messages : 3 839
    Points : 9 222
    Points
    9 222
    Par défaut

    On sait rien comment Sohpos crée son script pour la mise à jour ??
    Dans ce cas, il faut partager ce que vous avez déjà comme script et expliquer votre besoin en détails pour la modification !
    et

  3. #3
    Membre à l'essai
    Homme Profil pro
    Étudiant
    Inscrit en
    Janvier 2018
    Messages
    6
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 30
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Janvier 2018
    Messages : 6
    Points : 10
    Points
    10
    Par défaut
    Salut merci d'avoirs répondu !!

    Nous disposons de script pour Windows mais pas pour Sophos .
    Ma question et de trouver un script en vbs ou batch pour lancer la MAJ de Sophos client, nous ajouteront ce script a l'ouverture de session des users depuis l'AD .

    EXE UPDATE SOPHOS C:\Program Files (x86)\Sophos\AutoUpdate\ALUpdate.exe -> Cette outils lance la MAJ de l'AV Sophos

    Voici le script qu'on utilise pour la MAJ de Windows
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    Set updateSession = CreateObject("Microsoft.Update.Session")
    updateSession.ClientApplicationID = "MSDN Sample Script"
     
    Set updateSearcher = updateSession.CreateUpdateSearcher()
     
    WScript.Echo "Searching for updates..." & vbCRLF
     
    Set searchResult = _
    updateSearcher.Search("IsInstalled=0 and Type='Software' and IsHidden=0")
     
    WScript.Echo "List of applicable items on the machine:"
     
    For I = 0 To searchResult.Updates.Count-1
        Set update = searchResult.Updates.Item(I)
        WScript.Echo I + 1 & "> " & update.Title
    Next
     
    If searchResult.Updates.Count = 0 Then
        WScript.Echo "There are no applicable updates."
        WScript.Quit
    End If
     
    WScript.Echo vbCRLF & "Creating collection of updates to download:"
     
    Set updatesToDownload = CreateObject("Microsoft.Update.UpdateColl")
     
    For I = 0 to searchResult.Updates.Count-1
        Set update = searchResult.Updates.Item(I)
        addThisUpdate = false
        If update.InstallationBehavior.CanRequestUserInput = true Then
            WScript.Echo I + 1 & "> skipping: " & update.Title & _
            " because it requires user input"
        Else
            If update.EulaAccepted = false Then
                WScript.Echo I + 1 & "> note: " & update.Title & _
                " has a license agreement that must be accepted:"
                WScript.Echo update.EulaText
                WScript.Echo "Do you accept this license agreement? (Y/N)"
                strInput = WScript.StdIn.Readline
                WScript.Echo 
                If (strInput = "Y" or strInput = "y") Then
                    update.AcceptEula()
                    addThisUpdate = true
                Else
                    WScript.Echo I + 1 & "> skipping: " & update.Title & _
                    " because the license agreement was declined"
                End If
            Else
                addThisUpdate = true
            End If
        End If
        If addThisUpdate = true Then
            WScript.Echo I + 1 & "> adding: " & update.Title 
            updatesToDownload.Add(update)
        End If
    Next
     
    If updatesToDownload.Count = 0 Then
        WScript.Echo "All applicable updates were skipped."
        WScript.Quit
    End If
     
    WScript.Echo vbCRLF & "Downloading updates..."
     
    Set downloader = updateSession.CreateUpdateDownloader() 
    downloader.Updates = updatesToDownload
    downloader.Download()
     
    Set updatesToInstall = CreateObject("Microsoft.Update.UpdateColl")
     
    rebootMayBeRequired = false
     
    WScript.Echo vbCRLF & "Successfully downloaded updates:"
     
    For I = 0 To searchResult.Updates.Count-1
        set update = searchResult.Updates.Item(I)
        If update.IsDownloaded = true Then
            WScript.Echo I + 1 & "> " & update.Title 
            updatesToInstall.Add(update) 
            If update.InstallationBehavior.RebootBehavior > 0 Then
                rebootMayBeRequired = true
            End If
        End If
    Next
     
    If updatesToInstall.Count = 0 Then
        WScript.Echo "No updates were successfully downloaded."
        WScript.Quit
    End If
     
    If rebootMayBeRequired = true Then
        WScript.Echo vbCRLF & "These updates may require a reboot."
    End If
     
    WScript.Echo  vbCRLF & "Would you like to install updates now? (Y/N)"
    strInput = WScript.StdIn.Readline
    WScript.Echo 
     
    If (strInput = "Y" or strInput = "y") Then
        WScript.Echo "Installing updates..."
        Set installer = updateSession.CreateUpdateInstaller()
        installer.Updates = updatesToInstall
        Set installationResult = installer.Install()
     
        'Output results of install
        WScript.Echo "Installation Result: " & _
        installationResult.ResultCode 
        WScript.Echo "Reboot Required: " & _ 
        installationResult.RebootRequired & vbCRLF 
        WScript.Echo "Listing of updates installed " & _
        "and individual installation results:" 
     
        For I = 0 to updatesToInstall.Count - 1
            WScript.Echo I + 1 & "> " & _
            updatesToInstall.Item(i).Title & _
            ": " & installationResult.GetUpdateResult(i).ResultCode   
        Next
    End If

  4. #4
    Membre à l'essai
    Homme Profil pro
    Étudiant
    Inscrit en
    Janvier 2018
    Messages
    6
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 30
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Janvier 2018
    Messages : 6
    Points : 10
    Points
    10
    Par défaut
    J'ai réussi

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    Set WshShell = createobject("wscript.shell")
    Set oExec = WshShell.Exec("C:\Program Files (x86)\Sophos\AutoUpdate\ALUpdate.exe")

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Windows security and control
    Par Atori dans le forum Sécurité
    Réponses: 0
    Dernier message: 21/01/2011, 16h28
  2. Script VBS - Focus garder la fenêtre en premier plan
    Par Furius dans le forum VBScript
    Réponses: 4
    Dernier message: 12/12/2005, 23h27
  3. Réponses: 2
    Dernier message: 19/07/2005, 14h14
  4. Probleme recuperation d'une valeur : script vbs -> .bat
    Par pinpin_du_net dans le forum Windows
    Réponses: 3
    Dernier message: 10/05/2005, 12h43
  5. Imprimer un fichier texte avec un script vbs
    Par Persons dans le forum Windows
    Réponses: 3
    Dernier message: 23/12/2004, 16h47

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo