.NET C# Java Javascript Exception


Task Scheduler via Powershell

Let’s say we want to know the latest result of the “GoogleUpdateTaskMachineCore” task and the corresponding actions.

All you have to do is this (in a Run-As-Administrator Powershell console) :

Get-ScheduledTask | where TaskName -EQ 'GoogleUpdateTaskMachineCore' | Get-ScheduledTaskInfo

The result should look like this:

LastRunTime : 2/26/2019 6:41:41 AM
LastTaskResult : 0
NextRunTime : 2/27/2019 1:02:02 AM
NumberOfMissedRuns : 0
TaskName : GoogleUpdateTaskMachineCore
TaskPath : \
PSComputerName :

Be aware that the “LastTaskResult” might be displayed as an integer. The full “result code list” documentation only lists the hex value, so you need to convert the number to hex.

Now, if you want to access the corresponding actions you need to work with the “actual” task like this:

PS C:\WINDOWS\system32> $task = Get-ScheduledTask | where TaskName -EQ 'GoogleUpdateTaskMachineCore'
PS C:\WINDOWS\system32> $task.Actions

Id :
Arguments : /c
Execute : C:\Program Files (x86)\Google\Update\GoogleUpdate.exe
WorkingDirectory :
PSComputerName :

If you want to dig deeper, just checkout all the properties:

PS C:\WINDOWS\system32> $task | Select *

State : Ready
Actions : {MSFT_TaskExecAction}
Author :
Date :
Description : Keeps your Google software up to date. If this task is disabled or stopped, your Google
 software will not be kept up to date, meaning security vulnerabilities that may arise cannot
 be fixed and features may not work. This task uninstalls itself when there is no Google
 software using it.
Documentation :
Principal : MSFT_TaskPrincipal2
SecurityDescriptor :
Settings : MSFT_TaskSettings3
Source :
TaskName : GoogleUpdateTaskMachineCore
TaskPath : \
Triggers : {MSFT_TaskLogonTrigger, MSFT_TaskDailyTrigger}
URI : \GoogleUpdateTaskMachineCore
Version :
PSComputerName :
CimClass : Root/Microsoft/Windows/TaskScheduler:MSFT_ScheduledTask
CimInstanceProperties : {Actions, Author, Date, Description...}
CimSystemProperties : Microsoft.Management.Infrastructure.CimSystemProperties

If you have worked with Powershell in the past this blogpost should “easy”, but it took me a while to see the result code and to check if the action was correct or not.

Hope this helps!

.net web csharp asp.net javascript html5 asp.net-mvc jquery css iis
Weitere News:
3 Meinungen
Your writing very well and provide a lot of useful information. But if you tap water more than half as compared to another article, I would definitely be great
geometry dash
I am a home windows structures engineer who used NT, Command Shell for extra than a decade to do administrative duties. I had been hearing increasingly more approximately Powershell because the years handed however it just appeared https://www.ProHomeworkHelp.com so one of a kind from what I knew and turned into accurate at which made me worried to attempt. Early attempts simply brought about frustration so I gave up. An experienced Powershell man at paintings offered to educate us over more than one lunch hours in line with week and made this e-book the textbook for class.
Many students face the problem of stress in college. Whether it is because of social anxiety, or not being able to clear exam etc. Most of the times, students get stressed due to their piled up assignments. If it is with you also then you might seek for online Assignment Help.
Schreibe einen Kommentar:
iis css jquery asp.net-mvc html5 javascript asp.net csharp web .net
Entweder einloggen... ...oder ohne Wartezeit registrieren
Passwort wiederholen