• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 844
  • Last Modified:

How to use script to manually select ISA server by firewall client

We had a Microsoft ISA 2006 server. After install firewall client by login script, we want to use script to change firewall client  to manually select ISA server.
How can i do this?
Many thanks.
  • 2
1 Solution
Raj-GTSystems EngineerCommented:
The Firewall Client stores the configuration information on an .ini file under C:\Documents and Settings\username\Application Data\Microsoft\Firewall Client 2004.

You can use scripting or group policy preferences to edit common.ini file. The values are quite self explanatory...

ServerName -
Disbaled - Disables Firewall Client
Autodetection - 1 to enable and 0 to disable.

Hope this helps.
dickchanAuthor Commented:
Do you mind show me some example about how script to change ini file content?
I am a newbie. Many thanks.
Raj-GTSystems EngineerCommented:
You can use the attached script, which was from here - http://blogs.technet.com/pfe-ireland/archive/2008/05/08/scripting-how-to-edit-an-ini-file-from-a-script.aspx

Save the script as modini.vbs and call it from your log-on batch file like this

cscript //nologo modini.vbs "%appdata%\Microsoft\Firewall Client 2004\common.ini" "Autodetection" "0"
cscript //nologo modini.vbs "%appdata%\Microsoft\Firewall Client 2004\common.ini" "ServerName" "ISASERVERNAME"
cscript //nologo modini.vbs "%appdata%\Microsoft\Firewall Client 2004\common.ini" "TrayIconVisualState" "0"

The last line will hide the Firewall Client icon from the taskbar.

Hope this helps.
'Example: modini.vbs c:\folder\my.ini "Parameter" "new value"
Const ForReading = 1
Const ForWriting = 2
strINIFile = WScript.Arguments.Item(0)
strParam = WScript.Arguments.Item(1)
strValue = WScript.Arguments.Item(2)
If WScript.Arguments.Count <> 3 Then WScript.Quit
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile(strINIFile, ForReading)
Do Until objTextFile.AtEndOfStream
    strNextLine = objTextFile.Readline
    intLineFinder = InStr(strNextLine, strParam)
    If intLineFinder <> 0 Then
        strNextLine = strParam & "=" & strValue
    End If
    strNewFile = strNewFile & strNextLine & vbCrLf
Set objTextFile = objFSO.OpenTextFile(strINIFile, ForWriting)
objTextFile.WriteLine strNewFile

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

We Need Your Input!

WatchGuard is currently running a beta program for our new macOS Host Sensor for our Threat Detection and Response service. We're looking for more macOS users to help provide insight and feedback to help us make the product even better. Please sign up for our beta program today!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now