Welcome to ISAserver.org

Forums | Register | Login | My Profile | Inbox | RSS RSS icon | My Subscription | My Forums | Address Book | Member List | Search | FAQ | Ticket List | Log Out

URLSets add via vbs Enterprise Edition

Users viewing this topic: none

Logged in as: Guest
  Printable Version
All Forums >> [ISA Server 2004 Misc.] >> ISA Server 2004 Programming >> URLSets add via vbs Enterprise Edition Page: [1]
Login
Message << Older Topic   Newer Topic >>
URLSets add via vbs Enterprise Edition - 29.Jun.2005 9:54:00 AM   
chrigi-ch

 

Posts: 24
Joined: 3.Jun.2005
From: Zurich/Switzerland
Status: offline
Hi

I was working for a long time on this one. "[Cool]"
How to add URLs via vbScript into the ISA2004 EE:
Very Important: the Management console must be installed on the computer you want to run this code.
Just replace the correct Names of your
CSS, Array and the Name for your List.

code:
  

Sub AddRuleAndUrlSet()

CurrentISAName = "CSS-Server"
UserName = "Administrator"
DomainName = "Domainname"
Password = "password"
currentarrayname = "Arrayname"

Dim root, Regeln
Set root = CreateObject("FPC.root")
root.ConnectToConfigurationStorageServer CurrentISAName, UserName, DomainName, Password
Set CurrentISA2 = root.Arrays.Item(CurrentArrayName)

Set Enterprise1 = root.Enterprise
Set Rules = Enterprise1.RuleElements
Set URLLists = Rules.URLSets
' *** lists each URLList on the Array ***
For Each URLList In URLLists
WScript.Echo URLList
Next

WScript.Echo "*** Leerzeile ***"
Wscript.Echo "Inhalt von " & URLList & ": "

Rules.URLSets.Add("Name of URLList") '*** add a URLList
Set Listcontent=Rules.URLSets.Item("Name of URLList")
Listcontent.Description = "Description of the List"
WScript.Echo Listcontent.count
URLamount=Listcontent.count
For I = 1 To URLamount
WScript.Echo Listcontent.item(i)
Next

WScript.Echo "*** add some URLs ***"

Set Listcontent=Rules.URLSets.Item("Name of URLList")
WScript.Echo Listcontent.count
Listcontent.Add("http://*.bild.de/*")
Listcontent.Add("http://*.whitehouse.com/*")
Listcontent.Add("http://*.deutschland.de/*")
Listcontent.Add("http://*.northwindtraders.com/*")
Listcontent.Add("http://www.widgets.com/*")
Listcontent.Save

WScript.Echo "Saved!"

set root = Nothing

End Sub


AddRuleAndUrlSet



regards
Christian
Post #: 1
RE: URLSets add via vbs Enterprise Edition - 7.Aug.2005 11:41:00 AM   
tshinder

 

Posts: 47439
Joined: 10.Jan.2001
From: Texas
Status: offline
Hi Christian,

Thanks!
Tom

(in reply to chrigi-ch)
Post #: 2

Page:   [1] << Older Topic    Newer Topic >>
All Forums >> [ISA Server 2004 Misc.] >> ISA Server 2004 Programming >> URLSets add via vbs Enterprise Edition Page: [1]
Jump to:

New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts