To work with a configuration document, you must first add it to a policy object. To do this, type the following in a Windows PowerShell console, substituting the appropriate name for your policy after -PolicyRef:
New-FSysConfigDoc -Type FSys.am -PolicyRef MyPolicy
This adds an instance of the FSys.am configuration document to the policy named MyPolicy.
Because configuration documents contain many settings, you must work with them in an environment that can hold the entire group of settings. To work with the configuration document in the previous example, for instance, type the following in a Windows PowerShell console:
$am = Get-FSysConfigDoc -Type FSys.am -PolicyRef MyPolicy
$am is a variable that is used in the example in order to hold the FSys.am configuration document from the policy named MyPolicy.
Once the configuration document has been retrieved and assigned to a Microsoft .NET object, you can work with it as you would work with any other .NET object. You must enable the subsections within the configuration document (for example, General) in order to enable the individual settings within that section.
For example, to enable the General section in the FSys.am configuration document, type the following in a Windows PowerShell console:
$am.General.FSys.DocumentSection.FSys.Enabled = $True
This example sets the Enabled value for the General subsection (DocumentSection) to True. To enable other subsections in the FSys.am configuration document, substitute the subsection name for General in the example.
Once a subsection is enabled, you can then modify the values of the individual settings. Configuration documents have default attribute values that are enabled once a subsection has been enabled. For example, once the General subsection has been enabled, the General.Updates.IntervalUpdate.Enabled attribute is set to True, and the General.Updates.IntervalUpdate.Enabled.HourlyFrequency is set to 3.
To change the update frequency to every six hours, type the following in a Windows PowerShell console:
$am.General.Updates.IntervalUpdate.Enabled.HourlyFrequency.FSys.Value=6
Modifying an attribute that is a "choice"-type value is done in a different way. To access these settings, envision the settings that share the "choice" value as a mutually-exclusive selection list. For example, the settings for Interval and Daily scanning are "choice" values:
General.ScheduledScans.QuickScan.Enabled.Schedule.Interval
The "choice" between these two is the only "choice" to be made at this level, so the "choice" ordinal is 0. You must then set "choice 0" to the desired setting. To set QuickScan to run on a Daily schedule instead of an Interval schedule, type the following in a Windows PowerShell console:
$am.General.ScheduledScans.QuickScan.Enabled.Schedule.FSys.Choices[0].FSys.ActiveChoice="Daily"
If there are multiple "choices" at the level you need to configure, you must count to determine the ordinal for the "choice" you want to modify.
Once you have finished editing the configuration document, you must write the changes from the variable to the database. To do this, you use the Set-FSysConfigDoc cmdlet. Type the following in a Windows PowerShell console:
Set-FSysConfigDoc -InputObject $am