0

I am trying to change the expiry date of an Scheduled task using powershell because there are more than 40 tasks for users of same thing. schtasks.exe /Change /tn "Cache USer" /u "mydomain\administrator" /p <password> /ed 23/07/2019 but I get an error and translation or searches did not help.

FEHLER: Ungültige Syntax. Der Benutzername kann nicht ohne den Systemnamen angegeben werden. Geben Sie "SCHTASKS /?" ein,um die Syntax anzuzeigen.

translation is something like

ERROR: Invalid syntax. The user name cannot be changed without the system names can be specified. Enter "SCHTASKS /?

to display the syntax.

What is the problem it does not work evn if I use "/s" switch.

So server is a Windows 2012 R2 Terminal Server. DC is another system in the same network.

CanBuyukburc
  • 13
  • 1
  • 6

1 Answers1

0

You can use cmdlets for Scheduled Task in Powershell.

To set an expiry date you would need to use the EndBoundary property under Scheduled Task Triggers.

Powershell - Scheduled Tasks

Scheduled Task expire and delete using Powershell

Rajiv Iyer
  • 157
  • 9