On all the computers I support I want/need to monitor the performance of all physical disks regurlarly via a Powershell script started via Windows scheduler:
$out = winsat disk -seq -read -drive $laufwerk.deviceid
fails as $out only contains the first line of winsat-output:
Windows-Systembewertungstool
What do I miss or can you recommend another CLI-enabled tool for measuring disk performance?
I think you need to share more of your script and your settings for the scheduled task as I also cannot reproduce the problem. I ran a basic script as a scheduled task and the output file contained the full output.
Your script works fine for me as a scheduled task.
I donât think DWM would affect it. Thereâs a separate test for DWM and, while I donât know for certain, Iâm guessing the tool just checks to see if thatâs running in case you choose to run that test.
You are overwriting the file each time you loop. Is it possible that the last disk collected by Get-WMIObject is missing or has a problem which is preventing the assessment completing?
I would:
Evaluate the output of the Get-WMIObject command.
Add some logging so you know which device your script is currently processing.
Use Add-Content to append the data to the files instead of overwriting each time.
The script works fine if I start the scheduled task with the setting âonly execute if the user is logged onâ. It does not give winsat results if I start the scheduled task with the setting âexecute independently from the user loginâ. In both cases I start the scheduled task with highest privileges.
My standard unfortunately is the second as I want to have the script running independently from the user logged in. For this purpose I defined on every client a local administrator account âladminâ as task user for whom winsat obviously does not give any result!?
My way out (?): Integrate the script into the login procedure (most of my users have admin priviliges). Would you recommend another solution?
Sounded well but: winsat obviously only works as desired in scheduled tasks if this task runs under the ârealâ user and âonly execute if this user is logged inâ. In my business case I cannot afford this so I have to reswitch to âIntegrate the script into the login procedure (most of my users have admin privileges)â - Or would you recommend another solution?
When WinSAT runs, it writes a log file to C:\Windows\Performance\WinSAT
When the scheduled task is set to âRun whether user is logged on or notâ the following DirectX error is logged before the process exits.
4322171 (8328) - d3d\dx9misc.cpp:1035: HRESULT = 8876086c
4322171 (8328) - d3d\dx9misc.cpp:1035: Error: Unable to create the D3D device
4322171 (8328) - d3d\dx9misc.cpp:1035: Error: Unable to check the capabilities of the video card because a d3d device could not be created
4322171 (8328) - exe\processwinsaterror.cpp:0298: Unspecified error 24 occured.
As previously mentioned with regard to the DWM error, it looks like WinSAT checks all resources, even if itâs only running specific tests.
Probably worth noting that the default WinSAT scheduled task under Microsoft\Windows\Maintenance is set to âRun only when a user is logged onâ.
Thanks for explanation and all your efforts! My solution âIntegrate the script into the login procedureâ will work as well but the time to explore the reason for this behaviour is âoverwhelmingâ.