PowerShell Tutorial 41-47
PowerShell Tutorial 41-47
41
3. Navigate to the Actions tab and click New…. Here you can specify the actions that will be executed
whenever the trigger conditions are met. For instance, you can send an email or display a message. In our
case, we want to start a program. You can find the script here; it will send an alert with the event details
about the installed software.
Program\script — powershell
Add arguments (optional) — -File [Specify the file path to the script here]
42
4. The Conditions tab enables you to specify the conditions that, along with the trigger, determine whether
the task should be run. In our case, we should leave the default settings on this tab.
5. You can also set up additional parameters for your scheduled task on the Settings tab. For our example,
though, we’ll leave them unchanged.
43
6. When the task is completely set up, the system will ask you for the service account password. Note that
this account must have the “Log on as Batch Job” right. Enter the password and click OK to save the task.
7. For Task Scheduler to function properly, the Job Scheduler service must be set to start automatically. Run
Services.msc. In the list of services, find Task Scheduler and double-click it. On the General tab, set the
startup type to “Automatic” and click OK to save your change.
Now whenever new software is installed on your Microsoft Windows Server, you will be notified via an email
that details the time of the installation, the name of the software and the user ID (SID) of the person who
installed it.
To modify an existing task, right-click it in the list, select Properties, edit the required settings and click OK.
To delete a scheduled task, right-click it, select Delete and confirm the action.
44
Final Word
Let’s quickly summarize the key points of this Windows PowerShell tutorial. Now you know the basics of
PowerShell scripting, how to perform the most common Active Directory and file system management tasks
using PowerShell, and how to schedule PowerShell scripts. You might also want to check out the following
PowerShell scripts used by IT professionals to address specific cases:
How to Collect AD Site Information Using PowerShell
You can also further expand your knowledge of PowerShell by reviewing the following resources:
Netwrix Blog: PowerShell
45
Simplify Your Life with
Founded in 2006, Netwrix has earned more than 140 industry awards and been named to both the Inc. 5000
and Deloitte Technology Fast 500 lists of the fastest growing companies in the U.S.
Corporate Headquarters:
300 Spectrum Center Drive, Suite 200, Irvine, CA 92618
Phone: 1-949-407-5125 Toll-free: 888-638-9749 EMEA: +44 (0) 203-588-3023 netwrix.com/social