Datasheet

38 CHAPTER 1
USING POWERSHELL WITH ACTIVE DIRECTORY
FIGURE 1.13 Selecting the appropriate permissions for scheduling a script
5. Click the Actions tab, and click the New button to create a new action for this
task to perform. In the Action drop-down list, choose Start A Program. In the
Program/script text box, type
powershell.exe
. In the Add Arguments text
box, type the location of the script:
C:\Scripts\GetLogonStats.ps1
ese options are shown in Figure 1.14.
6. Click the OK button in the Edit Action dialog.
7. When youre back on the Action tab, click the New button to add another
action. In the New Action dialog select Send An E-mail from the Action list.
Fill out the options for the email message. Type
C:\Stats\LogonStats
.log
in the Attachment text box, and enter your SMTP server name in the
SMTP Server text box. Click OK to add the action.
8. Back in the Create Task dialog, click OK to create the task. You may be
prompted to enter the password for the account under which the task
will run.
c01.indd 38c01.indd 38 5/12/2011 1:07:53 PM5/12/2011 1:07:53 PM