0% found this document useful (0 votes)
4 views

PowerShell Tutorial 41-47

This document provides steps to configure a scheduled task in Windows Task Scheduler to run a PowerShell script whenever new software is installed on a Windows Server. The steps cover creating the task, specifying the trigger, actions, conditions and other settings. The summary also provides examples of common PowerShell scripts used by IT professionals.

Uploaded by

erster
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

PowerShell Tutorial 41-47

This document provides steps to configure a scheduled task in Windows Task Scheduler to run a PowerShell script whenever new software is installed on a Windows Server. The steps cover creating the task, specifying the trigger, actions, conditions and other settings. The summary also provides examples of common PowerShell scripts used by IT professionals.

Uploaded by

erster
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

2. Switch to the Triggers tab and click the New… button.

Here you can specify the conditions that trigger the


task to be executed. For example, you can have it executed on schedule, at logon, on idle, at startup or
whenever a particular event occurs. We want our task to be triggered by any new software installation, so we
choose On an event from the drop-down menu and select Application from the Log drop-down. Leave the
Source parameter blank and enter “11707” for the EventID. Click OK to save your changes.

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.

To schedule the PowerShell script, specify the following parameters:

Action — Start a program

Program\script — powershell

Add arguments (optional) — -File [Specify the file path to the script here]

Click OK to save your changes.

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

How Find Disabled or Inactive Users and Computers in AD

How to Find Locked Out User Accounts in AD

How to Find Account Lockout Source

How to Get a List of AD Users Whose Passwords Never Expire

How to Get a List of All Computers in an OU

How to Get a List of All Users from a Specific OU

How to Get an Active Directory OU Permissions Report

How to Export Active Directory Objects to CSV

How to Export Members of a Particular AD Group

How to Export Group Policy Settings

How to Determine Every AD User’s Last Logon Date

How to Get User Login History

How to Monitor AD Group Membership Changes

How to Detect Changes to OUs and Groups in AD

How to Determine Who Modified Permissions to an OU

How to Count Files in a Folder or a Directory

How to Get the ACL for a Folder

How to Monitor a Folder for New Files

How to Find Duplicate Files

How to Get Server Inventory Across Your Network

How to Get Local Group Membership Reports

How to List All User Accounts on a Windows System

How to Get Rid of Ransomware Using Free Tools and PowerShell

You can also further expand your knowledge of PowerShell by reviewing the following resources:
Netwrix Blog: PowerShell

Netwrix How-To Guides

45
Simplify Your Life with

the Top 7 Freeware Tools


for IT Professionals
Independently reviewed and recommended by leading industry experts, these tools
consistently prove themselves useful for IT pros. Audit Active Directory and file servers,
troubleshoot account lockouts, find stale accounts and more — all for free.

Netwrix Auditor Free Community Edition Free Download

Free Community Edition Free Community Edition Free Community Edition


Netwrix Auditor for Netwrix Auditor for Netwrix Auditor for
Active Directory Windows File Servers Windows Server

Free Download Free Download Free Download

Netwrix Account Netwrix Effective Netwrix Inactive


Lockout Examiner Permissions Reporting Tool User Tracker

Free Download Free Download Free Download


About Netwrix
Netwrix Corporation is a software company focused exclusively on providing IT security and operations
teams with pervasive visibility into user behavior, system configurations and data sensitivity across hybrid IT
infrastructures to protect data regardless of its location. Over 9,000 organizations worldwide rely on Netwrix
to detect and proactively mitigate data security threats, pass compliance audits with less effort and expense,
and increase the productivity of their IT teams.

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.

For more information about Netwrix, visit www.netwrix.com.

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

You might also like