Databases Reference
In-Depth Information
$policy.ScriptCreate().ToString()
$policy.ScriptAlter().ToString()
$policy.ScriptDrop().ToString()
# Get the object set for the Guest Permissions policy
$objectSet = Get-ChildItem -path SQLSERVER:\SQLPolicy\PowerPC\default\ObjectSets |
Where-Object {$_.Name -eq $policy.ObjectSet.ToString()}
$objectSet.ScriptCreate().ToString()
Figure 12-21
Part of the output is shown in Figure 12-22.
How do you evaluate a policy manually? The Evaluate method of the Policy classdidnotworkatthe
time this chapter was written. However, you can use the Invoke-PolicyEvaluation cmdlet provided by
the SqlServerCmdletSnapin100 snap-in. The policy to be evaluated is specified in the -Policy parameter
of this cmdlet. The -Policy parameter can take policies stored in an SQL Server instance or in XML files.
It can even take a string that specifies the names of one or more XML policy files, or a set of policy
objects, or a set of FileInfo objects that represent XML policy files. The policy objects can be passed
from a pipeline as well.
Search WWH ::




Custom Search