1

I have a Powershell script I want to schedule. With this script, I want to send out an email.

When scheduling it only when I'm logged on, everything runs fine. The email gets sent out, no issues whatsoever.

However, as soon as I select the option to run it whether I'm logged on or not, it returns the error code 0xfffd0000 with the result code being 4294770688.

I use the program powershell.exe and as arguments -File "L:[path]\test.ps1". The path is correct, and just using powershell.exe has worked when not selecting the "Run whether logged on or not".

I tried changing the path to "C:[path]\test.ps1" (And copying the powershell script there ofc), and that worked.

I have the "Log on as batch job" rights. I tried using a script that simply creates a txt file. There are no spaces in my path. I don't get any warnings at any step of the way. I tried using the admin user. I tried running the scheduler as admin. I tried checking the "Run with highest priviledges" option. I've tried changing the configured server from "Windows Vista, Windows Server 2008" to "Windows 7, Windows Server 2008 R" and to "Windows Server 2019".

It really seems to me that the issue lies with the fact that the script is located on a remote server. That is however not something I want to change. The script should be located on the remote server.

10
  • Which user account have you specified for the task? The default account doesn't have network permission even with "Run with highest privileges". Commented Jun 19, 2023 at 9:05
  • I have tried my own account and the admin account Commented Jun 19, 2023 at 9:23
  • Is it possible that the task has run before networking was fully functional? Commented Jun 19, 2023 at 9:34
  • I'm not sure what you mean by this, as I'm not very experienced in this domain, but are you asking if the script finished executing before the scheduler was able to connect to the user account? Commented Jun 19, 2023 at 9:38
  • 1
    @VomitIT-ChunkyMessStyle That worked like a charm, thank you very much! Commented Jun 20, 2023 at 6:18

1 Answer 1

0

@VomitIT-ChunkyMessStyle gave me a working solution in the comments:

When you select whether user is logged on or not, if the "L" drive is network, change that to be the UNC path which the "L" drive is mounted and reference it via \\serverxyz\sharexzy\[path]\test.ps1 and you should be good to go.

I'll just add for potential future readers: You can find UNC paths by typing net use in the cmd

1
  • Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center. Commented Jun 20, 2023 at 6:42

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.