Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 50 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
50
Dung lượng
1,2 MB
Nội dung
Using Task Scheduler CHAPTER 21
1003
<IdleSettings>
<Duration>PT10M</Duration>
<WaitTimeout>PT1H</WaitTimeout>
<StopOnIdleEnd>true</StopOnIdleEnd>
<RestartOnIdle>false</RestartOnIdle>
</IdleSettings>
<MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
<DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries>
<StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
<AllowHardTerminate>true</AllowHardTerminate>
<StartWhenAvailable>false</StartWhenAvailable>
<RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
<AllowStartOnDemand>true</AllowStartOnDemand>
<Enabled>true</Enabled>
<Hidden>false</Hidden>
<RunOnlyIfIdle>false</RunOnlyIfIdle>
<WakeToRun>false</WakeToRun>
<Priority>7</Priority>
</Settings>
<Actions Context="Author">
<Exec>
<Command>C:\Windows\System32\calc.exe</Command>
</Exec>
</Actions>
</Task>
Importing Tasks
Tasks that have been exported can also be easily imported to another computer or the same
computer.
To import a task, follow these steps:
1. Right-click a task folder under the Task Scheduler Library and then select Import Task,
or select Import Task in the Action pane.
2. Browse to where the .xml file is located and click Open. The task will be automatically
imported into the library using the settings contained in the .xml file.
note To ensure that the task runs properly, it is recommended that you verify the prop-
erties of the task after you import it.
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
CHAPTER 21 Maintaining Desktop Health
1004
Using SchTasks.exe for Creating and Managing Tasks
This section describes the SchTasks.exe command-line syntax and parameters. The Schtasks.exe
command-line interface utility allows an administrator to create, delete, query, change, run,
and end scheduled tasks on a local or remote system through the command shell.
Command Syntax
The SchTasks.exe command interface uses the following syntax:
SCHTASKS /<parameter> [arguments]
Command Parameters
The available parameters for SchTasks.exe are as follows:
n
/Create Creates a new scheduled task
n
/Delete Deletes the scheduled task(s)
n
/Query Displays all scheduled tasks
n
/Change Changes the properties of the scheduled task
n
/Run Runs the scheduled task immediately
n
/End Stops the currently running scheduled task
n
/? Displays a help message
Creating Tasks
The general syntax for Schtasks.exe is as follows:
SCHTASKS /Create [/S system [/U <username> [/P [<password>]]]] [/RU <username>
[/RP <password>]] /SC schedule [/MO <modifier>] [/D <day>] [/M <months>]
[/I <idletime>] /TN <taskname> /TR <taskrun> [/ST <starttime>] [/RI <interval>]
[ {/ET <endtime> | /DU <duration>} [/K] [/XML <xmlfile>] [/V1]] [/SD <startdate>]
[/ED <enddate>] [/IT] [/Z] [/F]
The following is an example command.
SCHTASKS /Create /S system /U user /P password /RU runasuser /RP runaspassword
/SC HOURLY /TN rtest1 /TR notepad
Deleting Tasks
The general syntax for deleting a task is as follows:
SCHTASKS /Delete [/S <system> [/U <username> [/P [<password>]]]] /TN <taskname>
[/F]
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
Using Task Scheduler CHAPTER 21
1005
The following is an example command.
SCHTASKS /Delete /TN "Backup and Restore”
Running Tasks
The general syntax for running a task is as follows:
SCHTASKS /Run [/S <system> [/U <username> [/P [<password>]]]] /TN <taskname>
The following is an example command.
SCHTASKS /Run /TN "Start Backup"
Ending Tasks
The general syntax for ending a task is as follows:
SCHTASKS /End [/S <system> [/U <username> [/P [<password>]]]] /TN <taskname>
The following is an example command.
SCHTASKS /End /TN "Start Backup"
Querying Tasks
The general syntax for querying a task is as follows:
SCHTASKS /Query [/S <system> [/U <username> [/P [<password>]]]] [/FO <format>]
[/NH] [/V] [/?]
The following is an example command.
SCHTASKS /Query /S system /U user /P password
SCHTASKS /Query /FO LIST /V
Changing Tasks
The general syntax for changing a task is as follows:
SCHTASKS /Change [/S <system> [/U <username> [/P [<password>]]]] /TN <taskname>
{ [/RU <runasuser>] [/RP <runaspassword>] [/TR <taskrun>] [/ST <starttime>]
[/RI <interval>]
[ {/ET <endtime> | /DU <duration>} [/K]] [/SD <startdate>] [/ED <enddate>] [/ENABLE |
/DISABLE] [/IT] [/Z] }
The following is an example command.
SCHTASKS /Change /RP password /TN "Backup and Restore"
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
CHAPTER 21 Maintaining Desktop Health
1006
Task Scheduler Events
In Windows Server 2003 and earlier versions, scheduled tasks used a Schedlgu.txt log file to
track tasks and their status. Windows Vista implements all new event logs for applications,
and Task Scheduler now logs all operational information about scheduled tasks into its own
event log. The Scheduled Tasks event log Microsoft-Windows-TaskScheduler is located under
Application Logs. Important errors or warnings about task or service failures are logged to
the System log so that administrators can readily see them and take action.
Task Scheduler 2.0 will normally log an event on task registration (at creation), at task
launch, and when the task instance has been sent to the engine. Events will also be logged on
task failures and any task-related problems. This section provides examples of typical events
that are logged by the Scheduled Tasks service.
Task Registration
An Event ID 106 is logged when a task is created. This event is also referred to as task
registration.
Task Launch
Tasks can be started by either a user request or a trigger. An Event ID 110 is normally logged
when a user manually starts a task. An Event ID 107 is normally logged when a task is started
as the result of a trigger.
Task Execution
An Event ID 319 indicates that the Task Engine received a message from the Task Scheduler
service requesting task launch, and it is the best indicator of a task launch. In these events, the
Task Engine is identified by the user SID, and the task name is also logged.
Task Completion
An Event ID 102 is normally logged when a task completes successfully.
Troubleshooting Task Scheduler
Task or service failures are logged to the system event log. It is important to note that the
events will vary and will be based on what failed. A user will see different events based on
whether a task failed to start or if the task started successfully but the action failed.
The key to troubleshooting Task Scheduler is understanding specifically where the failure
occurred in the process. A task is defined as an action, the trigger for the action, the conditions
under which the task will run, and additional settings. The event log will show whether the
failure is in the trigger, the task action, the conditions, or the settings of the task.
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
Using Task Scheduler CHAPTER 21
1007
Tasks Won’t Run If the Service Is Not Started
If you are having problems scheduling tasks or getting tasks to run correctly, first ensure
that the Task Scheduler service is running. You can run Services.msc to verify that the Task
Scheduler service status is Started.
The Task Did Not Run at the Expected Time
If a scheduled task does not run when you expect it to run, ensure that the task is enabled
and also check the triggers on the task to ensure that they are set correctly. Also, check the
history of the task, as shown in Figure 21-18, to see when the task was started and to check
for errors.
FIGURE 21-18 Task Scheduler History Tab
The Task Will Run Only If All Conditions Are Met
You can set task conditions on the Conditions tab of the Task Properties dialog box. If condi-
tions are not met or are set up incorrectly, the task will not execute.
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
CHAPTER 21 Maintaining Desktop Health
1008
The Task Will Run Only When a Certain User Is Logged On
If a scheduled task does not run when you expect it to run, review the Security Options set-
tings in the Task Properties dialog box on the General tab.
The Task Executed a Program But the Program Did Not Run Correctly
If a task attempts to execute a program, but the program does not run correctly, first try run-
ning the program manually (not from a task) to ensure that the program works correctly. You
may need to add arguments to the program command or define the Start In path using the
Add Arguments and Start In optional fields.
The Task Failed to Start
An Event ID 101 is normally logged when a task fails to start. In these events, the result code
is also displayed. For more information about result and return codes, see the section titled
“Interpreting Result and Return Codes” later in this chapter.
The Task Action Failed to Execute
When a task starts but the action configured for the task fails to execute, an Event ID 103 or
an Event ID 203 is normally logged. These events also display the return code. For more infor-
mation about result and return codes, see the section titled “Interpreting Result and Return
Codes” later in this chapter.
The Program Specified in the Task Requires Elevated Privileges
If a task is running a program that requires elevated privileges, ensure that the task runs with
the highest privileges. You can set a task to run with the highest privileges by changing the
task’s security options on the General tab of the Task Properties dialog box.
Interpreting Result and Return Codes
To interpret return codes, you can use a tool such as Err.exe, which you can obtain from the
Microsoft Download Center. Err.exe parses source-code header files until it finds a match for
the error. In this regard, the Scheduled Tasks service in Windows Vista still functions quite
similarly to previous versions of Windows. Return codes from events that occur internally are
always translated into hresult code. For example, the logon failed event will contain a result
code that can be interpreted as a hresult. Task handler tasks also return result codes that you
can interpret using the same tools.
However, when an executable is started and fails for an unknown reason, you have no
way of knowing what the result code might mean. The hresult logged in the event log will
typically indicate the value returned to the service from the executable itself, and additional
research and documentation may be required for accurately interpreting the code.
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
Understanding the Windows System Assessment Tool CHAPTER 21
1009
note You can download Err.exe from the Microsoft Download Center at
http://www.microsoft.com/downloads/details.aspx?familyid=be596899-7bb8-4208-b7fc-
09e02a13696c. Although this tool is called the Microsoft Exchange Server Error Code Look-
up tool, it actually looks up any Windows operating system error codes.
Understanding the Windows System Assessment Tool
You can use the Windows System Assessment Tool (WinSAT) to assess the features and capa-
bilities of a Windows PC. If the WinSAT scores have not been pre-populated by the original
equipment manufacturer (OEM), then WinSAT will run the following tests:
1. The DWM test during initial install or Out-of-Box Experience (OOBE), to provide the
Desktop Window Manager (DWM) with the video memory bandwidth data used in
determining whether Aero can run on a system.
2. The remaining tests on system idle (as an idle task, to be kicked off by the Task Sched-
uler when the computer is not busy).
In addition, WinSAT checks once a week whether new hardware has been installed on this
machine. If new hardware was installed and the current ratings are outdated, then WinSAT will
run on idle to update the ratings. WinSAT can also be run on demand, when the Re-run The
Assessment option is selected in the Performance Information And Tools Control Panel item.
diReCt FRoM tHe SoURCe
WinSAT Data Files
CSS Global Technical Readiness (GTR) Team
A
dvanced users may want more information regarding the Windows Experience
Index and system performance than is available in the Performance Informa-
tion And Tools Control Panel item. The underlying technology that supports the
Windows Experience Index is the WinSAT. This tool stores the 10 most recent assess-
ments in a data store folder located at:
%WinDir%\Performance\WinSAT\DataStore
The data store consists of XML files that contain information regarding each
assessment. These XML files contain details regarding system performance and
the Windows Experience Index. The files are named by the date and time the
assessments ran.
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
CHAPTER 21 Maintaining Desktop Health
1010
Understanding WinSAT Assessment Tests
WinSAT performs a variety of assessment tests on the hardware of a computer. These assess-
ment tests include:
n
cpu Measures the computation ability of the processor.
n
d3d The Direct3D (D3D) assessment is targeted at assessing a system’s ability to run
3D graphics; both business graphics and games.
n
disk Measures the performance of disk drives for sequential and random reads, and
for mixed read-write workloads.
n
dwm The DWM assessment is targeted at assessing a system’s ability to run a
Windows–composited desktop, usually referred to as Aero Glass. Note that these are
names of Aero themes. You can run this assessment only on computers with Windows
Display Driver Model (WDDM) video drivers.
n
features Enumerates relevant system information. This assessment is automatically
run once for each invocation of WinSAT.
n
formal Runs the full set of assessments and saves the results in the xml format
needed to populate the Windows Experience Index score and subscores in the
Performance Information And Tools Control Panel item.
n
media Measures the performance of video encoding and decoding.
n
mem Runs system memory bandwidth tests. This is intended to be reflective of large
memory-to-memory buffer copies, like those used in multimedia processing (video,
graphics, imaging, and so on).
n
mfmedia Runs the Media Foundation–based assessment.
Examining the WinSAT Features Assessment
WinSAT automatically runs the Features assessment each time WinSAT runs, to gather the
system information listed. This assessment enumerates system information relevant to the
assessments, including:
n
An optional globally unique identifier (GUID) if the –iguid command-line switch is used.
This ensures that each XML file has a unique identifier.
n
The iteration value from the –iter N command-line switch.
n
The number of processors, cores, and CPUs.
n
The presence of CPU threading technology.
n
x64 capability.
n
The processor signature.
n
The size and other characteristics of the processor’s L1 and L2 caches.
n
The presence of MMX, SSE, and SSE2 instructions.
n
Information on the memory subsystem. (Note that this is very system-dependent:
Some systems will produce good detail here; others will not.)
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
Understanding the Windows System Assessment Tool CHAPTER 21
1011
n
Graphics memory.
n
Graphics resolution.
n
Graphics refresh rate.
n
Graphics names and device IDs.
Running WinSAT from the Command Line
Although in most cases, WinSAT will not need to be executed manually from a command
prompt, the general format of the command line is as follows.
winsat <assessment_name> <assessment_parameters>
The WinSAT command-line options are not case sensitive. The command line does not
require a dash or forward slash for the assessment name, but it does support either a lead-
ing dash (–) or a leading forward-slash (/) character to designate an assessment parameter.
WinSAT can be run from a command shell with administrative privileges. An error may be
reported if any options or switches are not supported.
The WinSAT tool also supports several command-line switches in addition to the assess-
ment parameters. These are parsed by WinSAT before it passes control to one or more of the
assessments. Some of these parameters are also supported by one or more assessments. The
command-line parameters recognized by WinSAT include:
n
–csv This causes WinSAT to save the top-level measured metrics to a Comma-
Separated Value (CSV) file.
n
–help or ? Displays the help content.
n
–idiskinfo Information on the disk subsystem (logical volumes and physical disks) is
not normally saved as part of the <SystemConfig> section in the XML output.
n
–iguid Generates a GUID in the XML output file. Note that this is not valid with the
formal assessment.
n
–iter N Includes the iteration number <n> in the XML output file.
n
–v This specifies that WinSAT should produce verbose output. This output includes
progress and status information, and possibly error information. The default is for no
verbose output. This switch is passed to all of the specified assessments.
n
–xml file_name This specifies that the XML output from the assessment is to be
saved in the specified file name. All assessments support the –xml command-line
switch; a pre-existing file with the same name will be overwritten.
Understanding WinSAT Command Exit Values
WinSAT provides the following command exit values:
n
0 All requested assessments were completed successfully.
n
1 One or more assessments did not complete because of an error.
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
CHAPTER 21 Maintaining Desktop Health
1012
n
2 One or more assessments did not complete because of interference.
n
3 WinSAT was canceled by the user.
n
4 The command given to WinSAT was invalid.
n
5 WinSAT did not run with administrator privileges.
n
6 Another instance of WinSAT is already running.
n
7 WinSAT cannot run individual assessments (for example, D3D or DWM) on Remote
Desktop server.
n
8 WinSAT cannot run a formal assessment on batteries.
n
9 WinSAT cannot run a formal assessment on Remote Desktop server.
n
10 No multimedia support was detected, so the WinSAT tests could not be run.
n
11 This version of WinSAT cannot run on Windows XP.
n
12 The WinSAT watchdog timer timed out, indicating something is causing the tests
to run unusually slowly.
n
13 Can’t run a formal assessment on a Virtual Machine.
diReCt FRoM tHe SoURCe
When Does WinSAT Run?
Server Performance Group
Windows Fundamentals
I
n Windows Vista, all WinSAT tests were run during OOBE (the first-run install or
out-of-box experience) in order to ensure that all systems had detailed ratings, but
it took time (about 3-5 minutes).
In Windows 7, we’ve made the OOBE experience faster; only the DWM WinSAT test
needs to run during OOBE. That test provides the video bandwidth data used by the
DWM to determine whether Aero can be turned on. The remaining WinSAT tests
(other than the DWM test) run as idle tasks.
After the initial scores are populated, WinSAT checks weekly to see whether
hardware has changed sufficiently that the tests should be re-run. Customers can
also choose to manually re-rate the system at any time using Performance Infor-
mation And Tools in Control Panel. By default, WinSAT tracks the history of scores
on a machine. If the hardware components have not changed, the highest score is
maintained. This prevents temporary minor fluctuations in scoring; for example, if
someone re-ran the assessment while a complex application was also running and
competing for resources. To re-rate a system from scratch without taking history
into account, Performance Information And Tools has an Advanced Tools option to
“Clear all Windows Experience Index scores and re-rate the system.”
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
[...]... supported, however—for example, if a file transfer is initiated from a Windows XP or Windows Vista computer, Windows7 will accept the transfer For information on interoperability between the Windows XP, Windows Vista, and Windows7 versions of Remote Assistance, see the section titled “Interoperability with Remote Assistance in Windows XP” later in this chapter Understanding Remote Assistance Chapter... executable (Msra.exe) Remote Assistance in Windows7 and Windows Vista deprecates the following features that were available on Windows XP: n No more support for the MAILTO method of solicited Remote Assistance n No more support for voice sessions In addition, Remote Assistance in Windows7 has deprecated the file transfer feature that was available in Windows XP and Windows Vista Compatibility with earlier... SMAPI-compliant e-mail clients include Windows Mail, which is included in Windows Vista, and Microsoft Office Outlook 20 07 Windows7 does not have a built-in e-mail SMAPI-compliant client, but you can install Windows Live Mail, which is available for download as part of the Windows Live Essentials suite of applications (at http://get.live.com) Web-based e-mail services, such as Windows Live Hotmail, are not... 1035 n Implementing and Managing Remote Assistance 1052 n Summary 1 078 n Additional Resources 1 078 R emote Assistance (RA) in Windows Vista included improvements in connectivity, performance, usability, and security along with feature enhancements that make it even more useful than Remote Assistance in Windows XP was The Windows7 operating system builds on these earlier improvements with Easy Connect,... PDF Split-Merge on www.verypdf.com to remove this watermark Improvements to Remote Assistance in Windows7 As mentioned previously, Remote Assistance in Windows7 builds on the many enhancements introduced earlier for this feature in Windows Vista These earlier enhancements improved upon the earlier Windows XP implementation of Remote Assistance and included the following: n Connectivity improvements... for monitoring and maintaining desktop health of Windows 7 computers Using these tools, users can monitor event logs, manage tasks, monitor reliability, obtain performance information for their systems, configure WER, and perform other tasks that can help maintain the health of computers running Windows 7 in your organization Additional Resources These resources contain additional information and tools... information on how to use Performance Monitor in Windows 7, see http://technet.microsoft.com/en-us/library/cc749249.aspx n For more information concerning the Windows Performance Analysis Tools, see http://msdn.microsoft.com/en-us/performance/cc825801.aspx n For more information concerning Wevtutil.exe, see http://technet.microsoft.com/en-us /library/cc732848.aspx n For more information on how to manage... Source WER and SCOM 20 07 Dhananjay Mahajan, Senior Program Manager Enterprise Management Division A ll versions of Windows have a service called WER, which uses the WER client (on Windows Vista or later) or the Watson client (on earlier versions of Windows) to gather information about application and operating system crash WER then forwards the crashes to Microsoft for analysis SCOM 20 07 allows WER to first... uploaded behind-the-scenes Step 7: If a response is available from Microsoft, a notification is shown to the user Figure 21-20 Watson Feedback Platform flow diagram A significant improvement of WER in Windows Vista and later versions is the concept of queuing In Windows XP, WER reports could be sent only at the time the event occurred, with few exceptions Beginning with Windows Vista, WER provides a... architecture where users, administrators, and WER integrators can determine the queuing behavior of their WER events Understanding Windows Error Reporting Chapter 21 Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark 10 17 During the OOBE phase of installing Windows 7, the user can choose whether WER should automatically send basic problem reports to Microsoft Basic problem reports include .
technology comes out. For example, in Windows Vista, the maximum score was 5.9, while in
Windows 7, the maximum score is 7. 9. Each of the subscores also has. remove this watermark.
Understanding Windows Error Reporting CHAPTER 21
10 17
Understanding Windows Error Reporting
Windows Error Reporting (WER) is the