• RSS
  • Twitter
  • FaceBook

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

Converting URL lists to XML format

Users viewing this topic: none

Logged in as: Guest
  Printable Version
All Forums >> [ISA Server 2004 General ] >> General >> Converting URL lists to XML format Page: [1]
Login
Message << Older Topic   Newer Topic >>
Converting URL lists to XML format - 7.Sep.2005 7:31:00 AM   
simon.fking

 

Posts: 19
Joined: 29.Oct.2004
From: Australia
Status: offline
Hi,

I have some URL lists and would like to know how to convert them into ISA 2004. Do I need to convert them to XML first? They are currently in plain text format.

Thanks
Simon King
Post #: 1
RE: Converting URL lists to XML format - 7.Sep.2005 8:35:00 AM   
isawader

 

Posts: 420
Joined: 27.Apr.2005
Status: offline
You don't need to conver it into an XML file. Just import the URL list into ISA with the following script. Make sure each line of the file looks like the follwing and name the file "url.txt" (without the quotes).

http://www.isaserver.org
http://www.microsoft.com
http://www.whitehouse.gov

Here is the script. Create an URLset Network Object with the name "urls" (without the quotes). Copy everything below "------" line and paste into a notepad. Save the file as "urlset.vbs" (without the quotes). Make sure both url.txt and urlset.vbs files are on the same directory. I can't stress this enough. BACKUP ISA's CONFIGURATION BEFORE YOU DO ANYTHING!

--------------------------------------------------
Set Isa = CreateObject("FPC.Root")
Set CurArray = Isa.GetContainingArray
Set RuleElements = CurArray.RuleElements
Set URLSets = RuleElements.URLSets
Set URLSet = URLSets.Item("Urls")

Set FileSys = CreateObject("Scripting.FileSystemObject")

Set UrlsFile = FileSys.OpenTextFile("url.txt", 1)

For J = 1 to URLSet.Count
URLSet.Remove 1
Next

Do While UrlsFile.AtEndOfStream <> True
URLSet.Add UrlsFile.ReadLine
Loop

WScript.Echo "Saving..."
CurArray.Save
WScript.Echo "Done"

[ September 07, 2005, 08:36 AM: Message edited by: ISAwader ]

(in reply to simon.fking)
Post #: 2
RE: Converting URL lists to XML format - 7.Sep.2005 9:44:00 AM   
simon.fking

 

Posts: 19
Joined: 29.Oct.2004
From: Australia
Status: offline
Thanks for the reply ISAwader.

The lists I downloaded did not have the http:// at the start. So I modified the code on line 16 to:

URLSet.Add ("http://"+UrlsFile.ReadLine)

I also have found that the lists I have, have some duplicate entries in them, which the script complains about by saying:

------------------------------------------
Script: G:\urlset.vbs
Line: 16
Char: 1
Error: Cannot create a file when that file already exists.

Code: 800700B7
Source: (null)
------------------------------------------

Is there any way to alter the script to correct this? I have not used any VBS before, so I don't have much idea.

Thanks again,
Simon King.

(in reply to simon.fking)
Post #: 3
RE: Converting URL lists to XML format - 7.Sep.2005 12:53:00 PM   
isawader

 

Posts: 420
Joined: 27.Apr.2005
Status: offline
You can't have any duplicate in the list.

I think I also had the same issue. But I wrote a script that goes through the list and weeds out the duplicates and weird URLs. After that everything worked fine.

(in reply to simon.fking)
Post #: 4
RE: Converting URL lists to XML format - 7.Sep.2005 1:27:00 PM   
tshinder

 

Posts: 50013
Joined: 10.Jan.2001
From: Texas
Status: offline
Hey guys,

If you use domain name sets, you don't have to include http://

HTH,
Tom

(in reply to simon.fking)
Post #: 5
RE: Converting URL lists to XML format - 7.Sep.2005 7:53:00 PM   
simon.fking

 

Posts: 19
Joined: 29.Oct.2004
From: Australia
Status: offline
Hi,

Would you mind sharing the script to remove the duplicate entries by any chance?

Thanks
Simon King
simon@westgate.homeip.net

(in reply to simon.fking)
Post #: 6
RE: Converting URL lists to XML format - 7.Sep.2005 8:12:00 PM   
RedDog

 

Posts: 76
Joined: 11.Feb.2002
Status: offline
If its any help, I just dump the list into an Access database, with the pertinent field set to 'no duplicates', and any duplicates will not be added.

(in reply to simon.fking)
Post #: 7
RE: Converting URL lists to XML format - 7.Sep.2005 8:27:00 PM   
simon.fking

 

Posts: 19
Joined: 29.Oct.2004
From: Australia
Status: offline
Thanks,

I will use a database to store the URLs now. It will also allow me to put lists of what is blocked onto the intranet.

(in reply to simon.fking)
Post #: 8

Page:   [1] << Older Topic    Newer Topic >>
All Forums >> [ISA Server 2004 General ] >> General >> Converting URL lists to XML format 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