Microsoft Internet Security and Acceleration Server 2000

Web Publishing Script

The script that combines all of the steps in Web Publishing is shown in the following code.

Sub WebPublishing()
'Define the enumerated type values
const fpcRouteRedirect = 1
const fpcAppliesToAll = 0

'Create the root object
Set objFPC  = CreateObject ("FPC.Root")
'Get the current array
Set objArray = objFPC.Arrays.GetContainingArray
'Get the incoming Web request object
Set objWebRequest = objArray.ArrayPolicy.WebProxy.InComingWebRequests
'Tell the Web proxy not to listen on all interfaces.
objWebRequest.AllInterfaces = True
Set objServer = objArray.Servers.GetContainingServer
Set objListenEntry = objServer.ReverseProxyListenEntries.Add("2.2.2.2")
'Save your changes
objServer.Save
objListenEntry.Save
objWebRequest.Save
'Create the destination sets
' Get the destination sets collection
Set MyFPCDestinationSets = objArray.PolicyElements.DestinationSets
' add a new set to the collection
Set MyFPCDestinationSet = MyFPCDestinationSets.Add("Marketing")
' add a new destination to the set
Set MyFPCDestination = MyFPCDestinationSet.Add("example.microsoft.com", , "/Marketing/")
'Set the path
MyFPCDestination.SetDestinationAsDomain "example.microsoft.com","/Marketing/"

' add a new set to the collection
Set MyFPCDestinationSet = MyFPCDestinationSets.Add("Development")
' add a new destination to the set
Set MyFPCDestination = MyFPCDestinationSet.Add("example.microsoft.com", , "/Development/")
'Set the path
MyFPCDestination.SetDestinationAsDomain "example.microsoft.com","/Development/"
' save your changes
MyFPCDestinationSets.Save

'Configure the first Web publishing rule
'Get the publishing rules collection
Set PublishingRules = objArray.Publishing.WebPublishingRules
'Add the publishing rule
Set PublishingRule = PublishingRules.Add("Mktg redirect rule")
'Configure the rule
PublishingRule.SetWebSiteAndPorts fpcRouteRedirect, "Marketing"
PublishingRule.AppliesToMethod = fpcAppliesToAll
PublishingRule.Description = "Marketing Web publishing rule"
PublishingRule.Enabled = True
PublishingRule.Save

'Configure the second Web publishing rule
'Already have the collection, add the publishing rule
Set PublishingRule = PublishingRules.Add("Development redirect rule")
'Configure the rule
PublishingRule.SetWebSiteAndPorts fpcRouteRedirect, "Development"
PublishingRule.AppliesToMethod = fpcAppliesToAll
PublishingRule.Description = "Marketing Web publishing rule"
PublishingRule.Enabled = True
'Save changes to the collection
PublishingRules.Save
End Sub
WebPublishing