Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to: desktop apps only
The DestinationDomainNameSets property gets an FPCRefs collection that contains references to the FPCDomainNameSet collections defining the destination domain name sets included in or excluded from the destinations to which the rule applies.
This property is read-only.
Syntax
HRESULT get_DestinationDomainNameSets(
IFPCRefs **ppRefs
);
' Data type: FPCRefs
Property DestinationDomainNameSets( _
ByVal ppRefs As IFPCRefs _
) As FPCRefs
Property value
Reference to an FPCRefs collection that contains references to the destination domain name sets included in or excluded from the destinations to which the rule applies.
Error codes
This property method returns S_OK if the call is successful; otherwise, it returns an error code.
Remarks
This property is read-only. It can be modified by calling the methods of the FPCRefs collection retrieved (the IFPCRefs interface retrieved in C++).
The IncludeStatus property of each reference specifies whether the domain name set referenced is included in or excluded from the destinations to which the rule applies.
Examples
This VBScript script adds the user-specified domain name set to the destinations to which the user-specified access rule applies.
Option Explicit
'Define the constants needed
Const Error_FileNotFound = &H80070002
Const Error_AlreadyExists = &H800700B7
Const fpcPolicyRuleAccess = 0
Const fpcInclude = 0
Main(WScript.Arguments)
Sub Main(args)
If(2 <> args.Count) Then
Usage()
End If
AddDomainNameSetToAccessRule args(0), args(1)
End Sub
Sub AddDomainNameSetToAccessRule(ruleName, dnsetName)
' Create the root object.
Dim root ' The FPCLib.FPC root object
Set root = CreateObject("FPC.Root")
'Declare the other objects needed.
Dim isaArray ' An FPCArray object
Dim rules ' An FPCPolicyRules collection
Dim rule ' An FPCPolicyRule object
Dim dnSets ' An FPCDomainNameSets colection
Dim dnSet ' An FPCDomainNameSet object
' Get references to the array object, the policy rules collection,
' and the domain name sets collection.
Set isaArray = root.GetContainingArray()
Set rules = isaArray.ArrayPolicy.PolicyRules
Set dnSets = isaArray.RuleElements.DomainNameSets
' Retrieve the specified policy rule.
On Error Resume Next
Set rule = rules.Item(ruleName)
If err.Number = Error_FileNotFound Then
WScript.Echo "The access rule " & ruleName & " could not be found."
WScript.Quit
End If
Err.Clear
On Error GoTo 0
' Verify that the specified rule is an access rule.
If rule.Type <> fpcPolicyRuleAccess Then
WScript.Echo "The " & ruleName & " policy rule is not an access rule."
WScript.Quit
End If
' Verify that the specified domain name set exists.
On Error Resume Next
Set dnSet = dnSets.Item(dnsetName)
If err.Number = Error_FileNotFound Then
WScript.Echo "The domain name set " & dnsetName & " could not be found."
WScript.Quit
End If
Err.Clear
On Error GoTo 0
' Add the specified domain name set to the destinations specified as domain name sets
' to which the rule applies.
On Error Resume Next
rule.AccessProperties.DestinationDomainNameSets.Add dnsetName, fpcInclude
If err.Number = Error_AlreadyExists Then
WScript.Echo "The domain name set " & dnsetName & " is already referenced " _
& "by the access rule."
WScript.Quit
End If
Err.Clear
On Error GoTo 0
' Save the changes to the access rule.
rule.Save
WScript.Echo "Done!"
End Sub
Sub Usage()
WScript.Echo "Usage:" & VbCrLf _
& " " & WScript.ScriptName & " DomainNameSetName RuleName" & VbCrLf _
& "" & VbCrLf _
& " RuleName - Access rule which will use the domain name set" & VbCrLf _
& " DomainNameSetName - Domain name set for specifying destinations"
WScript.Quit
End Sub
Requirements
Minimum supported client |
Windows Vista |
Minimum supported server |
Windows Server 2008 R2, Windows Server 2008 with SP2 (64-bit only) |
Version |
Forefront Threat Management Gateway (TMG) 2010 |
IDL |
Msfpccom.idl |
DLL |
Msfpccom.dll |
See also
Build date: 7/12/2010