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

  FORUM HardWare.fr
  Programmation
  VB/VBA/VBS

  Extraction de ISA 2004/2006

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Extraction de ISA 2004/2006

n°1649700
Z_cool
HFR profile rating:⭐⭐⭐⭐
Posté le 27-11-2007 à 15:31:49  profilanswer
 

Salut,
 
J'espère qu'il y a qqe bidouilleur de ISA dans le coin.
 
En fait, je me suis fait/adapté un script qui extrait qqe paramètre de ISA2004/2006, Ce script est lancé de manière schedulé toutes les 15 minutes.
 
mais j'aimerais ne réellement faire un extract que si il y a des nouveautés dans les DestinationSet, UsersSets, ...  
 
Vous avez une idée ?
 
Le code, au cas ou ....

Code :
  1. '=========================================================================================
  2. Option Explicit
  3. Dim     DEBUG
  4.     DEBUG = true
  5. Dim    Destination
  6.     'Destination="L:ISA2004-2006"
  7.     Destination="si0vm055Isa2004-2006$"
  8. '=====================================================================================
  9. '###################################################################################
  10. 'MAIN - Hauptprozedur
  11. '-----------------------------------------------------------------------------------
  12.     Dim boolRunAsCScript 
  13.      
  14.     'Checking if code is running on cscript and not wscript...ie we are printing the output to the console
  15.     If (UCase(Right(WScript.FullName, 11)) <> UCase("CScript.exe";)) Then
  16.         WScript.Echo "Must be run under CScript" & "  Example: CScript " & ScriptName & ".vbe"
  17.     WScript.Echo vbTab & "Version " & SCRIPT_VERSION
  18.         boolRunAsCScript = False
  19.        
  20.         Call EndScript
  21.     Else
  22.         Dim StartTime
  23.             StartTime = Now()
  24.         boolRunAsCScript = True
  25.         Call StartScript
  26.         Call GetISAellements()
  27.         Call EndScript
  28.     End If
  29. '###################################################################################
  30. '=========================================================================================
  31. Sub EndScript() 'Alles was beim Ende des Sripted getan werden muß - wird immer aufgerufen
  32. End Sub 'EndScript() 'Alles was beim Ende des Sripted getan werden muß - wird immer aufgerufen
  33. '============================================================================
  34. '============================================================================
  35. Sub StartScript() 'Alles was beim Ende des Sripted getan werden muß - wird immer aufgerufen
  36. End Sub 'StartScript() 'Alles was beim Ende des Sripted getan werden muß - wird immer aufgerufen
  37. '============================================================================
  38. '=========================================================================================
  39. Sub GetISAellements() 'as String
  40.     'This routine will analyse all policies in the ISA Enterprise configuration
  41.     'and list all accounts defined in applies to. Additionally it will resolve all
  42.     'subtree groupmemberships for any group defined to list all user accounts that are
  43.     'affected by a policy
  44.    
  45.     Dim ISAEnterprise ' as FPCDS 'The ISA
  46.     Dim CompuSet, Compu, Urls, ISAUrlSet , Range, entRuleElement , DomNamSets
  47.     Dim USet, Account,dateLastMod,MyDate
  48.     Dim FileToSave ,File
  49.     Dim Count
  50.  
  51.     If (DEBUG)  Then wscript.echo  ("Connecting to the ISA Configuration...";)
  52.     Set ISAEnterprise = CreateObject ("FPC.Root";)
  53.     Set FileToSave = CreateObject ("Scripting.FileSystemObject";)
  54.     If FileToSave.FileExists(Destination &"exported.txt";) then
  55.     If (DEBUG)  Then wscript.echo  ("Last Export is not imported";)
  56.     wscript.Quit
  57.     end if
  58.    
  59.     'ISAEnterprise.ConnectToConfigurationStorageServer "localhost", "User1","ge.test", "cDFGpo25E"
  60.     ISAEnterprise.ConnectToConfigurationStorageServer "fe0bch.com", "q8fe","de", "Fosi0"
  61.  
  62.     dateLastMod = ISAEnterprise.Enterprise.LastModifiedTime
  63.     wscript.echo dateLastMod
  64.     wscript.echo Date()
  65.    
  66.    
  67.     set entRuleElement = ISAEnterprise.Enterprise.RuleElements
  68.  
  69.    
  70.    
  71.    '###############################################################################################
  72.    '# Computer
  73.    '###############################################################################################
  74.     wscript.echo "Computers"
  75.     Set File= FileToSave.OpenTextFile(Destination &"Computers.txt",2, true)
  76.     For Each Compu In entRuleElement.Computers
  77.         If (DEBUG )  Then wscript.echo  "   "&Compu.Name & " " & Compu.IPaddress
  78.         File.WriteLine Compu.Name & ";" & Compu.Description & ";" & Compu.IPaddress
  79.     Next
  80.     File.close
  81.     If (DEBUG )  Then wscript.echo ""
  82.    
  83.    
  84.    '###############################################################################################
  85.    '# Computers Sets
  86.    '###############################################################################################
  87.     wscript.echo "ComputerSet"
  88.     Set File = FileToSave.OpenTextFile(Destination &"ComputersSets.txt",2, true)
  89.     For Each CompuSet In entRuleElement.ComputerSets
  90.         File.WriteLine CompuSet.Name
  91.         File.WriteLine  ("<";)
  92.                
  93.         For Each Compu in CompuSet.Computers
  94.             If (DEBUG)   Then wscript.echo  "   Compu " & Compu.Name & ";" & Compu.IPaddress
  95.             File.WriteLine "Compu"& ";" & Compu.Name  & ";" & Compu.IPaddress
  96.           Next
  97.           For Each Range in CompuSet.AddressRanges
  98.             If (DEBUG)  Then  wscript.echo  "   Range " & range.Name & " "& Range.IP_From & " "& Range.IP_To
  99.             File.WriteLine   "Range" & ";" & range.Name & ";" & Range.IP_From & ";" & Range.IP_To
  100.         Next
  101.         File.WriteLine ">"
  102.         File.WriteLine  ("";)
  103.      Next
  104.      File.close
  105.      If (DEBUG )  Then wscript.echo ""
  106.     '###############################################################################################
  107.     '# URL Sets
  108.     '###############################################################################################
  109.      wscript.echo "URLSets"
  110.      Set File = FileToSave.OpenTextFile(Destination &"URLSets.txt",2, true)
  111.      For Each ISAUrlSet In entRuleElement.UrlSets
  112.          File.WriteLine ISAUrlSet
  113.         File.WriteLine  ("<";)   
  114.         For Count=1 to ISAUrlSet.Count
  115.             If (DEBUG )  Then wscript.echo "   " & ISAUrlSet.Item(Count)
  116.             File.WriteLine  ISAUrlSet.Item(Count)
  117.         Next
  118.         File.WriteLine  (">";)
  119.         File.WriteLine  ("";)
  120.      Next
  121.      File.close
  122.      If (DEBUG )  Then wscript.echo ""
  123.     '###############################################################################################
  124.     '# Domain Name Sets
  125.     '###############################################################################################   
  126.         wscript.echo "Domain Name Set"
  127.      Set File = FileToSave.OpenTextFile(Destination &"DomainNameSets.txt",2, true)
  128.      For Each DomNamSets In entRuleElement.DomainNameSets
  129.         If (DEBUG )  Then  wscript.echo "   DomNamSets: " & DomNamSets
  130.          File.WriteLine DomNamSets
  131.         File.WriteLine  ("<";)   
  132.         For Count=1 to DomNamSets.Count
  133.             If (DEBUG ) Then wscript.echo "     " & DomNamSets.Item(Count)
  134.             File.WriteLine  DomNamSets.Item(Count)
  135.         Next
  136.         File.WriteLine  (">";)
  137.         File.WriteLine  ("";)
  138.      Next
  139.      File.close
  140.      If (DEBUG )  Then wscript.echo ""
  141.    
  142.      '###############################################################################################
  143.      '# Users Sets
  144.      '###############################################################################################
  145.      wscript.echo "User Sets"
  146.      Set File = FileToSave.OpenTextFile(Destination &"UserSets.txt",2, true)
  147.      For Each USet In entRuleElement.UserSets
  148.         If (DEBUG )   Then wscript.echo  "   USets " & USet
  149.         File.WriteLine USet.Name
  150.         File.WriteLine  ("<";)
  151.                    
  152.         For Each Account in USet.Accounts
  153.             If (DEBUG )   Then wscript.echo  "    " & Account.Account
  154.             File.WriteLine Account.Account
  155.           Next
  156.         File.WriteLine ">"
  157.         File.WriteLine  ("";)
  158.      Next
  159.      File.close
  160.      If (DEBUG )  Then wscript.echo ""
  161.      Set File= FileToSave.OpenTextFile(Destination &"exported.txt",2, true
  162.      File.WriteLine "<"
  163.      File.WriteLine ">"
  164.      File.close
  165. End Sub 'GetISAellements()


Message édité par Z_cool le 27-11-2007 à 15:32:12

---------------
#mais-chut
mood
Publicité
Posté le 27-11-2007 à 15:31:49  profilanswer
 

n°1650097
Z_cool
HFR profile rating:⭐⭐⭐⭐
Posté le 28-11-2007 à 10:55:19  profilanswer
 

Mouai,... y a pas foule ....


---------------
#mais-chut
n°1650206
tegu
Posté le 28-11-2007 à 13:50:46  profilanswer
 

À mon avis ceux qui connaissent le mieux ISA et ses objets sont plutôt des admins système que des programmeurs.
Essaie peut-être de poster un sujet dans leur catégorie (si pas déjà fait)


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

  Extraction de ISA 2004/2006

 

Sujets relatifs
[Sybase,Xml] Extraction Sybase => XMLExtraction form / php
[Flash MX 2004] Interpolation de taille de rectangleComsol / Extraction ou calcul de la matrice jacobienne
[all]Extraction de l'informationMSSQL : extraction de données avec bcp et séparateur
[résolu] extraction du nom de fichier d'une urlExtraction de plusieurs requêtes SQL Server sous Word ou Excel
Extraction de données à partir d'un fichierOù downloader Jbuilder 2006 foundation
Plus de sujets relatifs à : Extraction de ISA 2004/2006


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