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

changing server publishing rule with C# app

Users viewing this topic: none

Logged in as: Guest
  Printable Version
All Forums >> [ISA Server 2004 Misc.] >> ISA Server 2004 Programming >> changing server publishing rule with C# app Page: [1]
Login
Message << Older Topic   Newer Topic >>
changing server publishing rule with C# app - 15.Mar.2006 1:01:05 PM   
tmz

 

Posts: 1
Joined: 13.Mar.2006
Status: offline
Hi!

I would like to write a C# windows application, where clicking on one butten would change Server IP address to a defined IP number. When clicking on another button would change to the other defined IP number.
I have ISA 2004.

First I wanted to do this with VBS, but all samples I found (also links on this forum, e.g.: http://www.isatools.org/) were for ISA 2000 and didn't work. I belive because the msfpccom.dll has changed. Because I didn't find any workig examples and IntelliSense is not working in VBS I switched to C#. But now I'm stucked with these too.

The VBS examples in ISA 2004 SDK are working. But there's no example for my problem.

How should I chenged the following VBS code tahat's workin on ISA2000:
 Dim objFPC, objArray, objSPR
 
 'Create the root object
 Set objFPC = CreateObject ("FPC.Root")
 
 'Make sure it's current data
 objFPC.Refresh
 
 'Find where we live
 Set objArray = objFPC.Arrays.GetContainingArray
 
 'Create the Server Publishing Rule object
 Set objSPR = objArray.Publishing.ServerPublishingRules("MyServerPubRule")
 
 'Display some kewl data
 Wscript.echo "SPR name: " & objSPR.Name
 Wscript.echo "old SPR IntIP: " & objSPR.InternalIp
 
 
 'Configure the rule
 if objSPR.InternalIp = "192.168.0.2" then
   objSPR.InternalIp = "192.168.0.3"
 Else
   objSPR.InternalIp = "192.168.0.2"
 End If
 
 'Save the changes
 objSPR.Save
 
 Wscript.echo "new SPR IntIP: " & objSPR.InternalIp
 


Also help to do this in C# would be appreciated. First I tried with adding Server publishin rule, but It's not working.
             FPCLib.FPCClass fpc = new FPCClass();
             
             fpc.GetContainingArray().ArrayPolicy.PolicyRules.AddServerPublishingRule("test111", "192.168.0.47", "DNS server");
             fpc.GetContainingArray().ArrayPolicy.PolicyRules.Save(true, true);
 


Thank you.

tmz
Post #: 1

Page:   [1] << Older Topic    Newer Topic >>
All Forums >> [ISA Server 2004 Misc.] >> ISA Server 2004 Programming >> changing server publishing rule with C# app 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