Chapter 9. Handling maintenance and support tasks

Throughout this book, I’ve discussed support and troubleshooting techniques that you can use to administer Windows 8.1. In this chapter, you’ll learn techniques for improving the support of computers regardless of their location and for recovering from specific types of problems. I’ll start with a look at automatic updates, and then look at how you can detect and resolve Windows errors. Also, don’t forget about the Steps Recorder (Psr.exe). As discussed in Chapter 6, you can use this tool to capture details related to the exact problem a user is having without needing access to the user’s computer.

Managing automatic updates

The standard automatic updating feature in Windows 8.1 is called Windows Update. Not only is Windows Update used to update the operating system, it’s also used to update programs that ship with the operating system and hardware device drivers. The sections that follow discuss how Windows Update works, and how it can be used to help keep a computer up to date.

Windows Update: the essentials

Windows Update is a client component that connects periodically to a designated server and checks for updates. After it determines that updates are available, it can be configured to download and install the updates automatically or to notify users and administrators that updates are available. The server component to which Windows Update connects is either the Windows Update website hosted by Microsoft or a designated Windows Update Services (WSUS) server hosted by your organization.

Windows Update supports distribution and installation of the following:

  • Critical updates. Updates that are determined to be critical for the stability and safeguarding of a computer

  • Security updates. Updates that are designed to make the system more secure

  • Update roll-ups. Updates that include other updates

  • Service packs. Comprehensive updates to the operating system and its components, which typically include critical updates, security updates, and update roll-ups

  • Optional updates. Updates that might be useful, including updates for drivers and firmware

Note

By default, Windows Update gets updates for drivers from the Windows Update website. You can also specify that you want Windows Update to search the Windows Server Update Services managed server for driver updates, or to first search the Windows Server Update Services managed server, but if no update is found there, then search Windows Update. To do this, enable and configure the Specify The Search Server For Device Driver Updates policy in the Administrative Templates policies for Computer Configuration under SystemDevice Installation. Select Search Managed Server or Search Managed Server and then WU, as appropriate.

A key part of the extended functionality enables Windows Update to prioritize downloads so that updates can be applied in order of criticality; therefore, the most critical updates will be downloaded and installed before less critical updates. You can also control how a computer checks for and installs new updates. The default polling interval used to check for new updates is 22 hours. Through Group Policy, you can change this interval. By default, every day at 2:00 A.M. local time, computers install updates they’ve downloaded. You can modify the installation to require notification or change the install times.

Windows 8.1 reduces the number of restarts required after updates by allowing a new version of an updated file to be installed even if the old file is currently being used by an application or system component. To do this, Windows 8.1 marks the in-use file for update, and then automatically replaces the file the next time the application is started. With some applications and components, Windows 8.1 can save the application’s data, close the application, update the file, and then restart the application. As a result, the update process has less impact on users.

Real World

Automatic updating uses the Background Intelligent Transfer Service (BITS) to transfer files. BITS is a service that performs background transfers of files and enables interrupted transfers to be restarted. BITS version 4.0, which is included with Windows 8.1, improves the transfer mechanism so that bandwidth is used more efficiently, which in turn means that less data is transferred and the transfer is faster. Through Group Policy, BITS can be configured to download updates only during specific times and to limit the amount of bandwidth used. You configure these and other settings by using the Set Up A Work Schedule To Limit The Maximum Network Bandwidth Used For BITS Background Transfers policy. This policy is found in the Administrative Templates policies for Computer Configuration under NetworkBackground Intelligent Transfer Service (BITS) in Group Policy. Additionally, by using BITS 4.0, Windows 8.1 can obtain updates from trusted peers across a local area network (LAN), as well as from an update server or from Microsoft directly. After a peer has a copy of an update, other computers on the local network can automatically detect this and download the update directly from the peer, meaning a required update might need to be transferred across the wide area network (WAN) only once rather than dozens or hundreds of times.

You can use automatic updating in several different ways. You can configure systems by using the following options:

  • Install Updates Automatically. With this option, the operating system retrieves all updates at a configurable interval (22 hours by default) and then installs the updates at a scheduled time, which by default is every day at 2:00 A.M. Users are not required to accept updates before they are installed. Updates are instead downloaded automatically and then installed according to a specific schedule, which can be once a day at a particular time or once a week on a particular day and time.

  • Download Updates But Let Me Choose Whether To Install Them. With this option (the default), the operating system retrieves all updates as they become available, and then prompts the user when the updates are ready to be installed. The user can then accept or reject each update. Accepted updates are installed. Rejected updates are not installed, but they remain on the system so that they can be installed later.

  • Check For Updates But Let Me Choose Whether To Download And Install Them. With this option, the operating system notifies the user before retrieving any updates. If the user elects to download the updates, she still has the opportunity to accept or reject them. Accepted updates are installed, whereas rejected updates are not installed; however, they remain on the system so that they can be installed later.

  • Never Check For Updates. When automatic updates are disabled, users are not notified about updates. Users can, however, download updates manually from the Windows Update website.

When Windows Update is configured for automatic download and installation, users are minimally notified of update availability or installation. You can get more information about an update by tapping or clicking a notification on the taskbar.

Restoring payloads and components via Windows Update

Windows can use Windows Update in several additional ways:

  • Windows Update is used to restore removed payloads.

  • Windows Update is used to reinstall corrupted components.

Binaries needed to install features of Windows are referred to as payloads. On servers running Windows Server 2012, not only can you uninstall an optional feature, but you can also uninstall and remove the payload for that optional feature by using the -Remove parameter of the Uninstall-WindowsFeature cmdlet.

You can install a feature and restore its payload by using the Install-WindowsFeature cmdlet. By default, payloads are restored via Windows Update. To specify alternate source file paths, you can enable and configure the Specify Settings For Optional Component Installation And Component Repair policy in the Administrative Templates policies for Computer Configuration under System. With this policy you can also specify that you never want to download payloads from Windows Update.

Alternate paths can be shared folders or Windows Imaging (WIM) files. Separate each alternate path with a semicolon. With WIM files, specify the Universal Naming Convention (UNC) path to the shared folder containing the WIM file and the index of the image to use with the following syntax.

wim:\ServerNameShareNameImageFileName.wim:Index

Here, ServerName is the name of the server, ShareName is the name of the shared folder, ImageFileName.wim is the name of the WIM file, and Index is the index of the image to use, such as

wim:\CorpServer62Imagesinstall.wim:2

If an operating system component is corrupted and Windows 8.1 detects this, the content required to repair the component can be downloaded from Windows Update. By default, the component update is done via Windows Server Update Services (WSUS), if available. By enabling and configuring the Specify Settings For Optional Component Installation And Component Repair policy, you can specify an alternate source file path. You can also specify that you want Windows Update to get the update directly from the Windows Update website, rather than going through WSUS.

Configuring automatic updating

Windows 8.1 organizes updates into the following broad categories:

  • Important updates. Includes critical updates, security updates, update roll-ups, and service packs for the operating system and programs that ship with the operating system

  • Recommended updates. Includes updates to drivers that are provided with the operating system and recommended optional updates

  • Microsoft product updates. Includes updates for other Microsoft products that are installed on the computer, in addition to new optional Microsoft software

  • Point and print drivers. Includes updates to drivers that provide client-side rendering capability

  • Firmware updates. Includes updates to firmware for tablets and other devices (but generally does not apply to PCs)

Note

By default, Windows Update includes updates to web compatibility lists from Microsoft. Sites listed are displayed in Compatibility view automatically. You can configure this feature by using the Include Updated Website Lists From Microsoft policy setting. In Group Policy, this setting is located in the Administrative Templates policies for Computer Configuration under Windows ComponentsInternet ExplorerCompatibility View.

Real World

When you are using a standard edition of Windows 8.1, Windows Update continues to search for compatible point and print drivers if it fails to find any on the computer itself or on the Windows Update site. If the computer does not find a match, it attempts to create a mismatch connection by using any available driver that supports the hardware. However, when you are using enterprise editions of Windows 8.1, you must explicitly enable the Extend Point And Print Connection To Search Windows Update policy to obtain the same behavior. This policy is found in Administrative Templates policies for Computer Configuration, under Printers.

Windows periodically checks to determine if updates are available whenever the computer has a connection to the Internet. Available updates are automatically downloaded in the background, provided the computer isn’t on a metered Internet connection. By default, Windows 8.1 is configured to automatically install important updates during the maintenance window. Note that if installing updates is allowed and an update for Windows Update is present, Windows Update will update itself prior to checking for other updates.

You can configure automatic updates on a per-computer basis by completing the following steps:

  1. In Control Panel, tap or click System And Security. Under Windows Update, tap or click Turn Automatic Updating On Or Off.

  2. Use the selection list provided to specify whether and how updates should occur (as shown in Figure 9-1).

  3. If you’ve enabled updates and also want to install drivers and optional updates, select the Give Me Recommended Updates The Same Way I Receive Important Updates check box.

  4. Tap or click OK.

Configure Windows Update.
Figure 9-1. Configure Windows Update.

By using an extension component called Microsoft Update, you can extend Windows Update to include updates for other Microsoft products that are installed on the computer, in addition to new optional Microsoft software. When you install some Microsoft products, including Microsoft Office, Microsoft Update can be downloaded and installed automatically as part of the setup process.

You can determine whether a computer is using Microsoft Update by following these steps:

  1. In Control Panel, tap or click System And Security, and then tap or click Windows Update.

  2. If the computer is configured to use Microsoft Update, you’ll get the following message in the lower portion of the page:

    You receive updates: For Windows and other products from Microsoft
    Update.

You can install Microsoft Update by completing the following steps:

  1. In Control Panel, tap or click System And Security, and then tap or click Windows Update.

  2. In the panel that says Get Updates For Other Products, click the related Find Out More link. This opens the Windows Update page at the Microsoft website in the default browser.

  3. After you read about Microsoft Update, select I Agree To The Terms Of Use, and then click Install.

  4. So long as automatic updates are enabled, the computer will get updates for Microsoft products as part of the automatic update process. From then on, when you are working with Windows Update, you can enable or disable Microsoft updates by selecting or clearing the Give Me Updates For Other Microsoft Products When I Update Windows check box.

By default, Windows Update runs daily at 2:00 A.M. as part of other automatic maintenance. Windows Update uses the computer’s power management features to wake the computer from hibernation or sleep at the scheduled update time and then install updates. Generally, this wake-up-and-install process will occur whether the computer is on battery or AC power.

If a restart is required to finalize updates applied as part of automatic maintenance and there is an active user session, Windows caches the credentials of the user currently logged on to the console and then restarts the computer automatically. After the restart, Windows uses the cached credentials to sign in as this user. Next, Windows restarts applications that were running previously, and then locks the session by using the Secure Desktop. If BitLocker is enabled, the entire process is also protected by BitLocker encryption.

Note

To be clear, the maintenance process normally runs whether a user is logged on or not. If no user is logged on when scheduled maintenance begins and a restart is required, Windows restarts the computer without caching credentials or storing information about running applications. When Windows restarts, Windows does not log on as any user.

Important

Because Windows automatically wakes computers to perform automatic maintenance and updates, you’ll also want to carefully consider the power options that are applied. Unless a power plan is configured to turn off the display and put the computer to sleep, the computer might remain powered on for many hours after automatic maintenance and updates.

You can change the restart behavior in several ways. If you don’t want updates to be installed automatically, you can select another update option, such as Download Updates But Let Me Choose When to Install Them. If you disable Sign-in Last Interactive User Automatically After A System-Initiated Restart, Windows will restart the computer but will not log in the last interactive user. In Group Policy, this setting is under Computer ConfigurationWindows ComponentsWindows Logon Options.

To change when automatic maintenance occurs, follow these steps:

  1. In Control Panel, tap or click System And Security. Under Windows Update, tap or click Turn Automatic Updating On Or Off.

  2. Tap or click the Updates Will Be Automatically Installed During The Maintenance Window link. Use the selection list provided to choose the preferred maintenance time, such as 5:00 AM (as shown in Figure 9-2).

  3. You can elect to wake the computer to perform scheduled maintenance by selecting the related check box. Unlike earlier releases of Windows that only wake the computer when it is on AC power, Windows 8.1 will wake the computer whether the computer is running on battery or AC power.

  4. Tap or click OK.

Manage the scheduled maintenance window.
Figure 9-2. Manage the scheduled maintenance window.

If the computer is in use or powered off at the scheduled maintenance time, automatic maintenance normally will run the next time the computer is powered on and idle. Automatic maintenance also runs when the computer is powered on and idle if maintenance is behind schedule.

You’ll find the following scheduled tasks related to automatic maintenance in the Task Scheduler Library, under WindowsTaskScheduler:

  • Regular Maintenance. Performs scheduled maintenance. When you change the maintenance schedule in Control Panel, Windows changes the run time for this task. This task runs whether a user is logged on or not and whether the computer is on AC or battery power. This task runs only when the computer is idle. If the computer isn’t idle, the task runs as soon as possible after the scheduled start is missed.

  • Manual Maintenance. Manually triggers maintenance. In Action Center, you can manually start maintenance by selecting the Start Maintenance option on the Maintenance panel. Later, you can select the Stop Maintenance option to stop maintenance that you manually started. This task runs whether a user is logged on or not and whether the computer is on AC or battery power. Although this task runs only when the computer is idle, Windows 8.1 does not attempt to run the task as soon as possible after you start it.

  • Maintenance Configurator. Updates the configuration of the Regular Maintenance task when you change the maintenance schedule. This task runs whether a user is logged on or not and whether the computer is on AC or battery power. This task runs only when the computer is idle. If the computer isn’t idle, the task runs as soon as possible after the scheduled start is missed.

  • Idle Maintenance. Triggers maintenance when the computer is idle. This task runs only when the computer is idle and running on AC power.

In an Active Directory domain, you can centrally configure and manage automatic updates by using the Administrative Templates policies for Computer Configuration under Windows ComponentsWindows Update. Table 9-1 summarizes the key policies and adds exceptions for a setting under User ConfigurationWindows Components and a setting under Computer ConfigurationWindows ComponentsWindows Logon Options. It’s important to note that the following policy settings do not apply to Windows 8 or later:

  • Enabling Windows Update Power Management To Automatically Wake Up The System To Install Scheduled Updates

  • Re-Prompt For Restart With Scheduled Installations

Tip

By using the Administrative Templates policies for Computer Configuration under Windows ComponentsMaintenance Scheduler, you can control the run schedule for automatic maintenance. The maintenance boundary is the daily scheduled time for starting automatic maintenance. For virtual machines running on a computer, Windows adds a random delay of up to 30 minutes. This delay is configurable as well.

Table 9-1. Policies for managing automatic updates

Policy

Function

Allow Automatic Updates Immediate Installation

When enabled, this setting allows automatic updates to immediately install updates that do not interrupt Windows services or require the computer to be restarted. These updates are installed immediately after they are downloaded.

Allow Non-Administrators To Receive Update Notifications

When enabled, this setting allows any user logged on to a computer to receive update notifications as appropriate for the automatic updates configuration. If the setting is disabled or not configured, only administrators receive update notifications.

Always Automatically Restart At Scheduled Time

When the setting is enabled, Windows always restarts at the scheduled time even if a user is logged on to an active session.

Automatic Updates Detection Frequency

When enabled, this setting defines the interval to be used when checking for updates. By default, computers check approximately every 22 hours for updates. If you enable this policy and set a new interval, that interval will be used with a wildcard offset of up to 20 percent of the interval specified. This means that if you set an interval of 10 hours, the actual polling interval would depend on the computer and be between 8 and 10 hours.

Configure Automatic Updates

When you enable this setting, you can configure how automatic updates work by using similar options to those described earlier in this section. You can also include the installation as part of scheduled maintenance (if enabled). To do this, enable and configure the policies under Computer ConfigurationWindows ComponentsMaintenance Scheduler.

Delay Restart For Scheduled Installations

By default, when a restart is required after an automatic update, the computer is restarted after a 15-minute delay. To use a different delay, enable this policy, and then set the delay time.

Enable Client-Side Targeting

When this setting is enabled and you’ve specified an intranet Microsoft update service location, an administrator can define a target group for the current Group Policy Object. With client-side targeting, administrators can control which updates are installed on specified groups of computers. Before an update is deployed, it must be authorized for a particular target group. The setting applies only when using an intranet Microsoft update service.

No Auto-Restart With Logged On Users For Scheduled Automatic Updates Installations

When enabled, this setting specifies that the computer will not automatically restart after installing updates that require a restart if a user is currently logged on. Instead, the user is notified that a restart is needed. Restarting the computer enforces the updates.

Remove Access To Use All Windows Update Features

When you enable this setting, all Windows Update features are removed. Users are blocked from accessing Windows Update, and automatic updating is completely disabled. (User Configuration policy)

Reschedule Automatic Updates Scheduled Installations

When enabled, this setting specifies the amount of time to wait after system startup before proceeding with a scheduled installation that was previously missed.

Sign-in Last Interactive User Automatically After A System-Initiated Restart

When this policy is disabled, Windows does not store the user’s credentials for automatic sign-in after a Windows Update restart.

(Windows Logon Options)

Specify Intranet Microsoft Update Service Location

When this setting is enabled, you can designate the fully qualified domain name of the Microsoft Update server hosted by your organization and of the related statistics server. Both services can be performed by one server.

Turn On Recommended Updates Via Automatic Updates

When this policy is enabled, recommended updates, including those for drivers and other optional updates, are installed along with important updates.

Checking for updates

The main Windows Update page provides details about the last time the computer or a user checked for updates, the last time updates were installed, and the current automatic update configuration. You can determine Windows Update usage or manually check for updates by following these steps:

  1. In Control Panel, tap or click System And Security. Tap or click Windows Update. As shown in Figure 9-3, statistics are provided about the most recent check for updates, the last time updates were installed (even if not completely successful), and the current update configuration.

    View update status.
    Figure 9-3. View update status.
  2. If you want to manually check for updates, tap or click Check For Updates.

  3. To install optional updates that might be available, tap or click the link that shows how many optional updates are available.

  4. On the Select Updates To Install page, select the updates to install. When you select an update, as shown in Figure 9-4, you’ll get additional information about the update, including the original release date, whether you’ll need to restart the computer to complete the update, and whether the update is ready to be installed. Often, you’ll also often have links to get additional information and support details.

  5. Tap or click Install to install the selected updates. At any time, you can review the update history to determine which updates succeeded or failed. If a problem occurs and you want to uninstall an update, you can remove the update.

    Select an update to get detailed information about the update.
    Figure 9-4. Select an update to get detailed information about the update.

Viewing update history and installed updates

The Windows Update download manager tracks both successful and failed updates by using an update history log. You can access this log by following these steps:

  1. In Control Panel, tap or click System And Security. Tap or click Windows Update.

  2. In the left panel, tap or click View Update History. This displays the View Update History page, shown in Figure 9-5.

    Check the update history to determine what updates have been installed.
    Figure 9-5. Check the update history to determine what updates have been installed.

On the View Update History page, updates listed with a Succeeded status were downloaded and installed. Updates listed with a Failed status were downloaded but failed to install. You also might get a status of Pending Restart or Canceled. Some updates can be completed only during startup of the operating system, and those updates will have a Pending Restart status. After the computer is restarted and the update is installed, the status will change as appropriate. The downloading of updates can be canceled for a variety of reasons. For example, users can cancel downloads of updates via Windows Update in Control Panel. Restarting the computer can cancel the download of an update as well.

To remove an update while accessing the View Update History page, tap or click Installed Updates. Then, on the Installed Updates page, press and hold or right-click the update that you do not want and tap or click Uninstall.

Removing automatic updates to recover from problems

If an automatic update causes a problem on a system, don’t worry. You can remove an automatic update in the same way in which you uninstall any other program. Simply follow these steps:

  1. In Control Panel, tap or click System And Security. Tap or click Windows Update.

  2. Tap or click View Update History, and then tap or click Installed Updates.

  3. To remove an update, select it in the list provided, and then tap or click Uninstall.

Hiding available updates

Over time, a user might accumulate a number of updates that were intentionally not installed but still appear on the list of updates available for installation. If you or the user has reviewed the update and you don’t want to install it, you can hide the update by completing the following steps:

  1. In Control Panel, tap or click System And Security. Tap or click Windows Update.

  2. Tap or click the link telling you how many updates are available.

  3. On the Select Updates To Install page, press and hold or right-click the update you do not want to install, and then tap or click Hide Update.

Restoring declined updates

If a user declines an update or has asked not to be notified about or install updates automatically, you can restore the updates so that they can be installed. To do this, complete the following steps:

  1. In Control Panel, tap or click System And Security. Tap or click Windows Update.

  2. Tap or click Restore Hidden Updates.

  3. On the Restore Hidden Updates page, select an update you want to install, and then tap or click Restore.

  4. Windows 8.1 will restore the update so that it can be selected and installed through the normal notification and installation process.

Detecting and resolving Windows 8.1 errors

Any particular computer can have dozens, and in some cases hundreds, of different components, services, and applications configured on it. Keeping all these components working properly is a big job, and the built-in diagnostics features discussed previously in this book do a good job of detecting common problems and finding solutions for them. As discussed in Chapter 8, known problems are tracked in the Problem Reports And Solutions console. Like the built-in diagnostic features, this console attempts to provide solutions to problems where possible. Not all problems can be automatically detected and resolved, and this is where the errors reported by Windows components, applications, services, and hardware devices become useful.

Using the event logs for error tracking and diagnosis

Windows 8.1 stores errors generated by processes, services, applications, and hardware devices in log files. Two general types of log files are used:

  • Windows logs. Logs used by the operating system to record general system events related to applications, security, setup, and system components

  • Applications and services logs. Logs used by specific applications or services to record application-specific or service-specific events

Entries in a log file are recorded according to the warning level of the activity. Entries can include errors in addition to general informational events. You’ll get the following levels of entries:

  • Information. An informational event, which is generally related to a successful action

  • Audit Success. An event related to the successful execution of an action

  • Audit Failure. An event related to the failed execution of an action

  • Warning. A warning, details of which are often useful in preventing future system problems

  • Error. An error, such as the failure of a service to start

In addition to level, date, and time, the summary and detailed event entries provide the following information:

  • Source. The application, service, or component that logged the event.

  • Event ID. An identifier for the specific event.

  • Task Category. The category of the event, which is sometimes used to further describe the related action.

  • User. The user account that was logged on when the event occurred. If a system process or service triggered the event, the user name is usually that of the special identity that caused the event, such as NetworkService, LocalService, or System.

  • Computer. The name of the computer on which the event occurred.

  • Details. In the detailed entries, this provides a text description of the event, followed by any related data or error output.

Viewing and managing the event logs

You can access event logs by using the Event Viewer node in Computer Management. To open Computer Management, from Control Panel, tap or click System And Security, Administrative Tools, and then Computer Management. Another way to open Computer Management is to press the Windows key, type compmgmt.msc, and then press Enter.

You can access the event logs by completing the following steps:

  1. Open Computer Management. You are connected to the local computer by default. If you want to view logs on a remote computer, press and hold or right-click the Computer Management entry in the console tree (left pane), and then tap or click Connect To Another Computer. In the Select Computer dialog box, enter the name of the computer to which you want access, and then tap or click OK.

  2. Expand the Event Viewer node, and then expand the Windows Logs node, the Application And Services Logs node, or both nodes to view the available logs.

  3. Select the log that you want to view, as shown in Figure 9-6.

Event Viewer displays events for the selected log.
Figure 9-6. Event Viewer displays events for the selected log.

More Info

Pressing Windows key + X provides a shortcut menu for quickly accessing frequently used tools, including Computer Management and Event Viewer. After you open Event Viewer, you can connect to other computers by right-clicking the Event Viewer entry in the console tree (left pane), and then tapping or clicking Connect To Another Computer.

Warnings and errors are the two key types of events you’ll want to examine. Whenever these types of events occur and you are unsure of the cause, double-tap or double-click the entry to view the detailed event description. Note the source of the error and attempt to resolve the problem by using the techniques discussed in this book. To learn more about the error and steps you can take to resolve it (if necessary), you can tap or click the Event Log Online link provided in the error description or search the Microsoft Knowledge Base for the event ID or part of the error description.

Scheduling maintenance tasks

When you manage desktop and laptop systems, you’ll often want to perform routine maintenance tasks on a periodic or recurring basis. To do this, you can use the Task Scheduler service to schedule one-time or recurring tasks to run automatically. You automate tasks by running command-shell scripts, Windows Script Host (WSH) scripts, or applications that execute the necessary commands for you. Unlike earlier releases of Windows, Windows 8.1 includes an extensive library of preconfigured tasks. These tasks handle everything from uninstalling a Bluetooth device to defragmenting disks to performing Windows Defender scans.

Understanding task scheduling

Windows 8.1 provides several tools for scheduling tasks, including the Task Scheduler, the Schtasks command-line tool, and several Windows PowerShell cmdlets. You can use any of these tools for scheduling tasks on local and remote systems. The Task Scheduler includes several wizards for scheduling tasks that provide point-and-click interfaces for task assignment. Schtasks is the command-line counterpart. Windows PowerShell cmdlets available include New-ScheduledTask, New-ScheduledTaskAction, Set-ScheduledTask, Start-ScheduledTask, and Stop-ScheduledTask.

All of these scheduling tools use the Task Scheduler service to monitor the system clock and run tasks at specified times. The Task Scheduler service logs on as the LocalSystem account by default. This account usually doesn’t have adequate permissions to perform administrative tasks. To overcome this problem, each task can be set to run as a specific user, and you set the user name and password to use when you create the task. Be sure to use an account that has adequate user privileges and access rights to run the tasks that you want to schedule.

Note

The focus of this section is on the Task Scheduler. This is the primary tool you’ll use to schedule tasks on Windows 8.1 systems. To learn more about Schtasks, enter schtasks /? at the command prompt.

Windows 8.1 has two general types of scheduled tasks:

  • Standard tasks. Used to automate routine tasks and perform housekeeping. These tasks are visible to users and can be modified if necessary.

  • Hidden tasks. Used to automate special system tasks. These tasks are hidden from users by default and should not be modified in most cases. Some hidden tasks are created and managed through a related program, such as Windows Defender.

In Windows 8.1, the creation and management of tasks is much more sophisticated than ever before. Every task can be configured to do the following:

  • Run only when a user is logged on, or run regardless of whether a user is logged on

  • Run with standard user privileges, or run with the highest privileges required (including administrator privileges)

Because tasks created on Windows 8 and later are not compatible with earlier releases of Windows, you cannot copy a Windows 8 or Windows 8.1 task to a computer running an earlier release of Windows and expect the task to run. However, when creating the task, you can specify that it should be created so that it is compatible with earlier releases of Windows so that you can use the task on computers running earlier releases of Windows.

Tasks can have many properties associated with them, including the following:

  • Triggers. Triggers specify the circumstances under which a task begins and ends. You can begin a task based on a schedule as well as on user logon, computer startup, or processor idling. You can also begin a task based on events, a user connecting or disconnecting from a Terminal Server session, or a user locking or unlocking a workstation. Tasks with event-based triggers can be the most powerful because they enable you to provide automated ways to handle errors and warnings.

  • Actions. Actions define the action a task performs when it is triggered. This allows a task to start programs, send email messages, or display messages.

  • Conditions. Conditions help qualify the conditions under which a task is started or stopped after it has been triggered. You can use conditions to wake the computer to run a task and to start the computer only if a specific network connection is available. You can use conditions to start, stop, and restart a task based on the processor idle time. For example, you might want to start a task only if the computer has been idle for at least 10 minutes, stop the task if the computer is no longer idle, and then restart the task again if the computer becomes idle once more. You can also use conditions to specify that a task should start only if the computer is on AC power and stop if the computer switches to battery power.

Windows 8.1 uses scheduled tasks to perform many routine maintenance tasks. Table 9-2 shows key tasks that are specific to Windows 8.1 PCs. Conditions and settings might be different for tablets and devices running Windows 8.1.

Table 9-2. Important tasks that are new for Windows 8.1

Task NameTask Description

Runs Only When Idle

Runs Only On AC Power

Run as soon as Possible if Missed

Runs if no user Logged on

ApplicationData

When you start a program, Windows uses the Cleanup Temporary State task to clean up temporary files that were created the last time the program was used.

Yes

Yes

Yes

Yes

AppxDeploymentClient

Windows uses the Pre-Staged App Cleanup task to clean up pre-staged apps whenever a user logs on or starts a pre-staged app.

Yes

Yes

No

Yes

Data Integrity Scan

When you use storage pools with Windows 8.1, Windows uses the related tasks to scan fault-tolerant volumes for latent corruptions and to perform fast crash recovery of fault-tolerant volumes.

No

Yes

Yes

Yes

FileHistory

When the File History featured is configured, Windows uses this task to protect user files by copying them to a backup location.

No

Yes

No

Yes

SettingSync

These tasks are used to sync Microsoft accounts. You’ll find separate tasks for background uploads, backups, and tasking network state changes.

Yes

No

Varies by task

No

SkyDrive

These tasks are used to sync Microsoft accounts. You’ll find separate tasks for syncing general settings when idle and performing routine maintenance.

Yes

Yes

No

No

SpaceAgent

SpaceAgentTask runs at startup and whenever you start SpaceAgent.exe. Windows uses this task to gather information about storage spaces being used.

Yes

No

No

Yes

Sysmain

These tasks are used to maintain hybrid drives and to maintain the working set.

Yes

Varies by task

No

Yes

TPM

These tasks are used to maintain a computer’s TPM.

No

No

No

Yes

Work Folders

These tasks are used to initiate synchronization of Work Folders when a user logs on and to perform related maintenance.

No

Varies by task

Varies by task

No

Viewing and managing tasks on local and remote systems

The current tasks configured on a system are accessible through the Task Scheduler node in Computer Management. Tasks are organized and grouped together by using a familiar folder structure, where base folders are named according to the operating system features, tools, and configuration areas to which they relate. Within a base folder, you’ll find one or more related tasks.

You can view and manage the scheduled tasks configured on a computer by completing the following steps:

  1. Open Computer Management. You are connected to the local computer by default. If you want to view tasks on a remote computer, press and hold or right-click the Computer Management entry in the console tree (left pane), and then tap or click Connect To Another Computer. In the Select Computer dialog box, enter the name of the computer that you want to access, and then tap or click OK.

  2. Expand the Task Scheduler node, and then select the Task Scheduler Library node and view task status and active tasks as shown in Figure 9-7. The Task Status panel provides a summary of tasks running, stopped, and failed for a specified time period, which by default is the last 24 hours. The Active Tasks panel provides the name, next run time, run triggers, and location of all enabled tasks.

    Select a task folder to view the related tasks.
    Figure 9-7. Select a task folder to view the related tasks.
  3. When you select a task folder in the console tree, the first task in the folder is selected by default. If the folder has multiple tasks and you want to work with a different task, select that task instead.

  4. When you’ve selected the task with which you want to work, you can view its properties by using the tabs shown in Figure 9-8. If you want to manage the task, press and hold or right-click the task in the main pane, and then do the following:

    • Tap or click Delete to delete a task.

    • Tap or click Disable to disable a task.

    • Tap or click Properties to edit the task’s properties. Make the appropriate changes in the Properties dialog box, and then tap or click OK.

    • Tap or click Export to export a task to a file that can be imported on another computer. After you export the task, use Computer Management to connect to the other computer, press and hold or right-click the Task Scheduler Library node, and then tap or click Import Task. You can then use the Open dialog box to locate and open the task on the other computer.

    • Tap or click Run to run the task.

    • If the task is running, tap or click End to stop the task.

    Note

    Although you can modify and delete user-created tasks, most tasks created by the operating system cannot be configured or deleted. If operating system tasks are not shown, you can display these tasks by tapping or clicking View, and then selecting Show Hidden Tasks. Note also that when you are exporting tasks, the task’s Configure For drop-down list setting determines the operating systems with which the task can be used.

View and manage scheduled tasks.
Figure 9-8. View and manage scheduled tasks.

You can view the scheduled tasks currently running on a computer by completing the following steps:

  1. Open Computer Management. You are connected to the local computer by default. If you want to view tasks on a remote computer, press and hold or right-click the Computer Management entry in the console tree (left pane), and then tap or click Connect To Another Computer. In the Select Computer dialog box, enter the name of the computer that you want to access, and then tap or click OK.

  2. Select the Task Scheduler node to read in its attributes. Press and hold or right-click the Task Scheduler node, and then select Display All Running Tasks.

Creating scheduled tasks

You can create a scheduled task by completing the following steps:

  1. Open Computer Management. You are connected to the local computer by default. If you want to create tasks on a remote computer, press and hold or right-click the Computer Management entry in the console tree (left pane), and then tap or click Connect To Another Computer. In the Select Computer dialog box, enter the name of the computer that you want to access, and then tap or click OK.

  2. Select and then press and hold or right-click the Task Scheduler node, and then tap or click Create Task. This starts the Create Task Wizard.

  3. On the General tab, enter the name of the task, and then set security options for running the task:

    • If the task should run under a user account other than that of the current user, tap or click Change User Or Group. Use the Select User Or Group dialog box to select the user or group under which the task should run, and then provide the appropriate credentials when prompted later.

    • Set other run options as necessary by using the options provided. By default, tasks run only when a user is logged on. If you want to run the task regardless of whether a user is logged on, select Run Whether User Is Logged On Or Not. You can also elect to run with highest privileges and configure the task for specified releases of Windows.

  4. Use the Configure For list to choose the compatibility level. To configure the task for Windows 7 and later, choose Windows 7, Windows Server 2008 R2. To configure the task specifically for Windows 8.1 and later, choose Windows 8.1.

  5. On the Triggers tab, create and manage triggers by using the options provided. To create a trigger, tap or click New, use the options provided to configure the trigger, and then tap or click OK.

  6. On the Actions tab, create and manage actions by using the options provided. To create an action, tap or click New, use the options provided to configure the action, and then tap or click OK.

  7. On the Conditions tab, specify any limiting conditions for starting or stopping the task.

  8. On the Settings tab, choose any additional optional settings for the task.

  9. Tap or click OK to create the task.

Troubleshooting scheduled tasks

When you configure tasks to run on a computer, you can encounter several types of problems. Some tasks won’t run when they are supposed to. Others will start but won’t stop. To determine the status of a task, select the task in the Task Scheduler and note the status, last run time, and last run result. If a task has a status of Queued, it is waiting to run at a scheduled time. If a task has a status of Ready, it is ready to run at its next run time. If a task should be running automatically but has a last run time of Never, you need to check the task’s properties to determine why it isn’t running. If the last run result is an error, you need to resolve the referenced problem so that the task can run normally.

Check a task’s properties by tapping or clicking its entry in the Task Scheduler. The History tab provides detailed information on the task, from creation to its latest run time. Use the information to help you resolve problems with the task.

A task that is listed as Running might not, in fact, be running but instead might be a hung process. You can check for hung processes by using the Last Run Time column, which tells you when the task was started. If a task has been running for more than a day, there is usually a problem. A script might be waiting for input, the task might have problems reading or writing files, or the task might simply be a runaway task that needs to be stopped. To stop the task, press and hold or right-click it in the Task Scheduler, and then tap or click End.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset