Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1193 connectés 

  FORUM HardWare.fr
  Programmation
  VB/VBA/VBS

  [VBS] WSUS téléchargement et installation

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

[VBS] WSUS téléchargement et installation

n°1900620
3xc4l18ur
question = ( to ) ? be : ! be;
Posté le 30-06-2009 à 15:58:48  profilanswer
 

Bonjour,
 
Je suis en train de faire un VBS qui télécharge et installe les mise a jour validée sur mon WSUS.
C'est pas bien compliqué car MS le fournit :p
http://msdn.microsoft.com/en-us/li [...] S.85).aspx
 
Mais je voulais pouvoir gérer une blacklist en local.
En fait je souhaiterais comparé l'update.title aux lignes contenu dans un fichier annexe, et s'il y est présent, ne pas l'installer malgré sa dispo sur le WSUS. (voir le IF en commentaire)
 
Merci [:atog]  
 
 

Code :
  1. 'Setting Objects
  2. Set updateSession = CreateObject("Microsoft.Update.Session" )
  3. Set updateSearcher = updateSession.CreateupdateSearcher()
  4. Set updatesToProcess = CreateObject("Microsoft.Update.UpdateColl" )
  5. Err.clear
  6. Set searchResult = updateSearcher.Search("IsInstalled=0 and Type='Software'" )
  7. For I = 0 To searchResult.Updates.Count-1
  8. Set update = searchResult.Updates.Item(I)
  9. wscript.echo "" & update.Title
  10. Next
  11. If searchResult.Updates.Count = 0 Then
  12. wscript.echo "No applicable updates."
  13. WScript.Quit
  14. End If
  15. wscript.echo "Collection of updates to download:"
  16. For I = 0 to searchResult.Updates.Count-1
  17. Set update = searchResult.Updates.Item(I)
  18.         ' IF not update.Title in c:\temp\blacklist.txt then
  19.      wscript.echo "" & update.Title
  20.      updatesToProcess.Add(update)
  21.         'End If
  22. Next
  23. 'Set downloader = updateSession.CreateUpdateDownloader()
  24. 'downloader.Updates = updatesToProcess
  25. 'downloader.Download()
  26. 'Set installer = updateSession.CreateUpdateInstaller()
  27. 'installer.Updates = updatesToProcess
  28. 'Set installationResult = installer.Install()

mood
Publicité
Posté le 30-06-2009 à 15:58:48  profilanswer
 

n°1900759
3xc4l18ur
question = ( to ) ? be : ! be;
Posté le 30-06-2009 à 20:56:10  profilanswer
 

Oula, pas tous a la fois /o\
 
Menfin merci quand meme :p


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  VB/VBA/VBS

  [VBS] WSUS téléchargement et installation

 

Sujets relatifs
Problème installation joomla chez freeAcceder à des bases Access en VBS
[VBS] Supprimer des espaces dans un fichier texte[VBS][Résolu] Supprimer une ligne dans Excel
[VBS] Convertir VBS en un éxécutable, est-ce possible ?[VBS][RESOLU][SCRIPT]Script de suppression de fichiers temporaires
[VBS] Récuperer contenu fichier texte dans une variable:Problème installation FCKeditor
Permission non accordée : erreur avec VBS[VBS] Est-il possible d'intercepter un kill
Plus de sujets relatifs à : [VBS] WSUS téléchargement et installation


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR