Z_cool HFR profile rating:⭐⭐⭐⭐ | 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 :
- '=========================================================================================
- Option Explicit
- Dim DEBUG
- DEBUG = true
- Dim Destination
- 'Destination="L:ISA2004-2006"
- Destination="si0vm055Isa2004-2006$"
- '=====================================================================================
- '###################################################################################
- 'MAIN - Hauptprozedur
- '-----------------------------------------------------------------------------------
- Dim boolRunAsCScript
-
- 'Checking if code is running on cscript and not wscript...ie we are printing the output to the console
- If (UCase(Right(WScript.FullName, 11)) <> UCase("CScript.exe";)) Then
- WScript.Echo "Must be run under CScript" & " Example: CScript " & ScriptName & ".vbe"
- WScript.Echo vbTab & "Version " & SCRIPT_VERSION
- boolRunAsCScript = False
-
- Call EndScript
- Else
- Dim StartTime
- StartTime = Now()
- boolRunAsCScript = True
- Call StartScript
- Call GetISAellements()
- Call EndScript
- End If
- '###################################################################################
- '=========================================================================================
- Sub EndScript() 'Alles was beim Ende des Sripted getan werden muß - wird immer aufgerufen
- End Sub 'EndScript() 'Alles was beim Ende des Sripted getan werden muß - wird immer aufgerufen
- '============================================================================
- '============================================================================
- Sub StartScript() 'Alles was beim Ende des Sripted getan werden muß - wird immer aufgerufen
- End Sub 'StartScript() 'Alles was beim Ende des Sripted getan werden muß - wird immer aufgerufen
- '============================================================================
- '=========================================================================================
- Sub GetISAellements() 'as String
- 'This routine will analyse all policies in the ISA Enterprise configuration
- 'and list all accounts defined in applies to. Additionally it will resolve all
- 'subtree groupmemberships for any group defined to list all user accounts that are
- 'affected by a policy
-
- Dim ISAEnterprise ' as FPCDS 'The ISA
- Dim CompuSet, Compu, Urls, ISAUrlSet , Range, entRuleElement , DomNamSets
- Dim USet, Account,dateLastMod,MyDate
- Dim FileToSave ,File
- Dim Count
-
- If (DEBUG) Then wscript.echo ("Connecting to the ISA Configuration...";)
- Set ISAEnterprise = CreateObject ("FPC.Root";)
- Set FileToSave = CreateObject ("Scripting.FileSystemObject";)
- If FileToSave.FileExists(Destination &"exported.txt";) then
- If (DEBUG) Then wscript.echo ("Last Export is not imported";)
- wscript.Quit
- end if
-
- 'ISAEnterprise.ConnectToConfigurationStorageServer "localhost", "User1","ge.test", "cDFGpo25E"
- ISAEnterprise.ConnectToConfigurationStorageServer "fe0bch.com", "q8fe","de", "Fosi0"
-
- dateLastMod = ISAEnterprise.Enterprise.LastModifiedTime
- wscript.echo dateLastMod
- wscript.echo Date()
-
-
- set entRuleElement = ISAEnterprise.Enterprise.RuleElements
-
-
-
- '###############################################################################################
- '# Computer
- '###############################################################################################
- wscript.echo "Computers"
- Set File= FileToSave.OpenTextFile(Destination &"Computers.txt",2, true)
- For Each Compu In entRuleElement.Computers
- If (DEBUG ) Then wscript.echo " "&Compu.Name & " " & Compu.IPaddress
- File.WriteLine Compu.Name & ";" & Compu.Description & ";" & Compu.IPaddress
- Next
- File.close
- If (DEBUG ) Then wscript.echo ""
-
-
- '###############################################################################################
- '# Computers Sets
- '###############################################################################################
- wscript.echo "ComputerSet"
- Set File = FileToSave.OpenTextFile(Destination &"ComputersSets.txt",2, true)
- For Each CompuSet In entRuleElement.ComputerSets
- File.WriteLine CompuSet.Name
- File.WriteLine ("<";)
-
- For Each Compu in CompuSet.Computers
- If (DEBUG) Then wscript.echo " Compu " & Compu.Name & ";" & Compu.IPaddress
- File.WriteLine "Compu"& ";" & Compu.Name & ";" & Compu.IPaddress
- Next
- For Each Range in CompuSet.AddressRanges
- If (DEBUG) Then wscript.echo " Range " & range.Name & " "& Range.IP_From & " "& Range.IP_To
- File.WriteLine "Range" & ";" & range.Name & ";" & Range.IP_From & ";" & Range.IP_To
- Next
- File.WriteLine ">"
- File.WriteLine ("";)
- Next
- File.close
- If (DEBUG ) Then wscript.echo ""
- '###############################################################################################
- '# URL Sets
- '###############################################################################################
- wscript.echo "URLSets"
- Set File = FileToSave.OpenTextFile(Destination &"URLSets.txt",2, true)
- For Each ISAUrlSet In entRuleElement.UrlSets
- File.WriteLine ISAUrlSet
- File.WriteLine ("<";)
- For Count=1 to ISAUrlSet.Count
- If (DEBUG ) Then wscript.echo " " & ISAUrlSet.Item(Count)
- File.WriteLine ISAUrlSet.Item(Count)
- Next
- File.WriteLine (">";)
- File.WriteLine ("";)
- Next
- File.close
- If (DEBUG ) Then wscript.echo ""
- '###############################################################################################
- '# Domain Name Sets
- '###############################################################################################
- wscript.echo "Domain Name Set"
- Set File = FileToSave.OpenTextFile(Destination &"DomainNameSets.txt",2, true)
- For Each DomNamSets In entRuleElement.DomainNameSets
- If (DEBUG ) Then wscript.echo " DomNamSets: " & DomNamSets
- File.WriteLine DomNamSets
- File.WriteLine ("<";)
- For Count=1 to DomNamSets.Count
- If (DEBUG ) Then wscript.echo " " & DomNamSets.Item(Count)
- File.WriteLine DomNamSets.Item(Count)
- Next
- File.WriteLine (">";)
- File.WriteLine ("";)
- Next
- File.close
- If (DEBUG ) Then wscript.echo ""
-
- '###############################################################################################
- '# Users Sets
- '###############################################################################################
- wscript.echo "User Sets"
- Set File = FileToSave.OpenTextFile(Destination &"UserSets.txt",2, true)
- For Each USet In entRuleElement.UserSets
- If (DEBUG ) Then wscript.echo " USets " & USet
- File.WriteLine USet.Name
- File.WriteLine ("<";)
-
- For Each Account in USet.Accounts
- If (DEBUG ) Then wscript.echo " " & Account.Account
- File.WriteLine Account.Account
- Next
- File.WriteLine ">"
- File.WriteLine ("";)
- Next
- File.close
- If (DEBUG ) Then wscript.echo ""
- Set File= FileToSave.OpenTextFile(Destination &"exported.txt",2, true)
- File.WriteLine "<"
- File.WriteLine ">"
- File.close
- End Sub 'GetISAellements()
|
Message édité par Z_cool le 27-11-2007 à 15:32:12 ---------------
#mais-chut
|