Getting Started

This section is a walkthrough guiding you through the process of creating your first script assignment in a GPO. Having it execute on a client and displaying the script feedback in the Specops Command Group Policy Editor Snap-in.

Edit a Group Policy object

To create your first script assignment you must first select a Group Policy Object to work with. Start the Microsoft Group Policy Management Console (GPMC) and locate or create the desired GPO. Make sure that the GPO you use is linked so that it applies to the computers where you have deployed the Specops Command Client Side Extension. Right-click the GPO and select Edit.

The Main page of the Specops Command Snap-inThis will open the Group Policy Editor MMC. From here browse to the Systems Management node and the Specops Command node beneath this. The Specops Command node is available both in the computer and user part of the GPO. This way scripts can be executed in both the computer and the user context. For this walkthrough we will stay on the computer side.

Enter License information

Entering license informationBefore getting anywhere in Specops Command you must enter the license information. Upon downloading or purchasing Specops Command you receive a license file. Click the Licensing button on the main page of the Specops Command Snap-in. Use the Import license file button to browse to the license file. Read the Licensing section for more information about the Specops Command licensing modes.

Your first Script Assignment

The Script Assignment windowNow, lets create the first script assignment. You guessed it, click the New script assignment button. The will display the Script Assignment window. At the top of this window you need to enter a name of the script assignment. Make sure to select a descriptive name. For this example you can use Start alerter service. Below the script assignment name you will see four tabs, called Script, Undo Script, Target and Schedule. The following sections will briefly explain what these tabs are about.

Script

The one tab you will always use is the Script tab. This is where you write your PowerShell or VBScript. For the purpose of this example, lets use this harmless PowerShell script.

$serviceName = "alerter"  

$service = Get-Service -Name $serviceName  
if ($service.Status -eq "Stopped" )  
{  
  $service.Start()  
}

Target

A computer name target criterionIn the target page you can scope what computers (or users if in the user part) will receive the script assignment. The Specops Command targeting system is very powerful and versatile. For this example we will use a computer name target criterion. Enable targeting by checking the box for it. Then click the down arrow on the Add target criterion and locate the Computer names criterion type. From the following dialog use the Add button to browse to a computer name using the Windows standard object browser.

Make sure you select the name of the computer you want to test the script assignment on. This computer must have the Specops Command Client Side Extension installed and the GPO you are currently editing must be linked so that it applies to the computer.

Schedule

Example of a weekly scheduleLets move on to the schedule tab. The scheduleing system of Specops Command allows you to make a detailed time schedule for when and how often a certain script assignment should be executed.

You can for example configure a script assignment to run only at night time, on specific weekday, or only once ever. For this sample lets not use a schedule as we want the script assignment to be executed right away. By not using a schedule, we are telling Specops Command to execute the script during every GPO interval, both foreground (at startup/logon) and in background.

Undo Script

The last tab to investigate is the Undo script. The actual layout of the tab is identical to that of the Script tab, with one addition. A checkbox at the top to enable or disable this feature. The undo script will be executed on all clients that have executed the Script when they fall out of scope of management.

Scope of management A computer is said to be in the scope of management of a GPO if the GPO is linked to the computer, in some way. And any security group filters, WMI filters are configured so that the GPO is actually applied to the specific computer. If any of these things are changed so that the GPO no longer applies to a computer, the computer “falls out of scope of management”

In addition, in Specops Command a computer can fall out of scope of management for a certain script assignment in two other ways. The target of the script assignment stops applying to the computer, either because of changes on the computer or changes in the target, or a script assignment is deleted.

In all these cases, the Undo Script for the script assignment will be executed on the client.

For this example we leave the Undo Script empty.

Saving the Script Assignment

The script assignment is now done and we need to save it. The changes we have done so far have not been applied and will not be so until you click the OK button of the Script Assignment window. As soon as you click this button the script assignment is stored in the GPO and computers or users that it applies to may start executing it.

Forcing the script to execute on the client

Now, to test this script assignment we could just be patient and wait for the next Group Policy refresh cycle to occur on the client we are testing with. Group Policies are automatically applied every 90 minutes with a random offset of 0–30 minutes, on any given computer.

But we are impatient so lets force a Group Policy refresh on the client computer. From a command prompt or the Run dialog on the client computer, run the gpupdate command. This forces the a Group Policy refresh.

Checking the feedback

After the Group Policies have been applied on the computer lets check the feedback. From the main page in the Specops Command Snap-in all the existing script assignments are displayed with summarized feedback data. If you kept your fingers crossed there should be a 1 in the success column for the script assignment you created.

The Detailed Feedback windowTo view more detailed feedback for a script assignment, click the corresponding button and the detailed feedback window will open. From this window you can configure filters before clicking the Display button which will retrieve the data from the Specops Command Server. You can also right click the grid columns to select which columns to display.

Page last modified on October 13, 2008, at 08:52 PM