Windows Server 2008 : Security Configuration Wizard (part 2) - Using scwcmd
Using scwcmd
The scwcmd tool is used to manipulate policies created by the SCW. The following table shows some common uses.
| scwcmd Command | Comments |
|---|---|
Create a GPO from a SCW policy.
scwcmd transform /p:policy- | Transforms
a security policy file generated by using SCW into a new Group Policy
object (GPO) in Active Directory Domain Services (AD DS).
The /p switch needs to include the path to the SCW policy file, and the /g switch names the GPO. Figure 2 shows the GPO named SCWTest created in the Group Policy Management Console (GPMC) from this command.Tip The case you use for the GPO is used when the GPO is created. For example, if you use /g:scwtest, the GPO is named scwtest, but if you use /g:SCWTest, the GPO uses the same case named SCWTest.Note Although the GPO is created and accessible in the GPMC, it is not linked anywhere by default. You must take the extra step in the GPMC to link it. |
Analyze a computer against a policy.
scwcmd analyze /m:computer- | Determines
whether a computer is in compliance with a policy. It compares the
policy against the computer (or computers) and creates a file
indicating any discrepancies.
You can run the command against the local computer without the /m or /ou switch, a remote computer with the /m switch, or an OU with the /ou switch. The first example analyzes the local system, the second example analyzes a server named dc1, and the third example analyzes all the computers in the Sales OU. You can then view the xml file identified by the /p switch, which documents any discrepancies. |
Configure systems with the policy.
scwcmd configure /m:computer- | The configure command applies a SCW-generated security policy to one or more computers. This syntax is similar to the analyze command. You can apply it to the local computer, a remote computer with the /m switch, or all computers in an OU with the /ou switch. |
Roll back a policy.
scwcmd rollback /m:computer- | Applies
the most recent rollback policy available, and then deletes that
rollback policy. You can roll back a policy on only one computer at a
time.
Note Rollback policies are created and stored in the c:\windows\security\msscw\rollbackfiles folder by default. |
View a policy.
scwcmd view /x:policy-file.xml | Displays an xml file in an interactive page. Figure 3 shows the result of this command. |
Figure 2. Transforming an SCW policy to a GPO
Figure 3. Viewing an SCW policy from scwcmd