Run New-PSSession as Scheduled Task

An internal error occurred.
PSInvalidOperationException
+ FullyQualifiedErrorId : CreateRemoteRunspaceFailed

After literally 2 hours bashing my head why a scheduled task would not run as a service account. But worked fine with normal account.

Granting the ‘Allow log on as batch job’, ‘Allow log on locally’, and even adding the account to the Local Administrators group on all servers still the same error kept coming up.

Thanks to a beautiful link from this large post:

http://ramblingcookiemonster.github.io/Task-Scheduler/

 

There’s a reference to a very obscure fix:

Create the following two folders:
C:\Windows\System32\config\systemprofile\Desktop
C:\Windows\SysWOW64\config\systemprofile\Desktop

 

Total Views: (32)

Leave a Reply

Your email address will not be published. Required fields are marked *

Connect with Facebook

*