Cannot run scheduled script as NT AUTHORITY\ SYSTEM


  1. Posts : 271
    Windows 10
       #1

    Cannot run scheduled script as NT AUTHORITY\ SYSTEM


    I use Synology NAS as my file and app server. I am trying to run a scheduled script as NT AUTHORITY\SYSTEM but whenever I try it, it fails with error code 0xFFFD0000

    Like this,

    Program: powershell.exe
    Arguement: -ExecutionPolicy Bypass -File \\NAS\Scripts\Script.ps1
      My Computer


  2. Posts : 16,953
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #2

    Perhaps the answer lies in whatever method you are using to try to run as the System 'user'.
    You don't say why you have to use that 'user'.

    Perhaps the System 'user' does not have access to the folder containing the ps1 file.
    0xFFFD0000 - The field “Add arguments (optional)” contains an invalid file name.

    Perhaps it's more mundane - PowerShell Scheduled task fails with error code: 0xFFFD0000 and 4294770688 if Run Hourly Every Day - Stack Overflow


    Denis
      My Computer


  3. Posts : 271
    Windows 10
    Thread Starter
       #3

    Try3 said:
    Perhaps the answer lies in whatever method you are using to try to run as the System 'user'.
    You don't say why you have to use that 'user'.

    Perhaps the System 'user' does not have access to the folder containing the ps1 file.
    0xFFFD0000 - The field “Add arguments (optional)” contains an invalid file name.

    Perhaps it's more mundane - PowerShell Scheduled task fails with error code: 0xFFFD0000 and 4294770688 if Run Hourly Every Day - Stack Overflow


    Denis
    Yes that's probably why, it doesn't have access because this isn't an AD environment, my Synology NAS doesn't permit me to add my hostname ($COMPUTER) to the list of "people" that can access my share

    Because when you run a script as NT AUTHORITY\SYSTEM, the computer is going to try to run the file as $COMPUTER (my hostname basically) but that "user" doesn't have access to the file share, only my (windows user account) has

    Why am I trying to run the script as SYSTEM? Because I use this winget script to update the software on my systems 1x every day at 10AM without any UAC prompts, window pop-up, it's completely silent and runs in the background. The log files say it runs just fine when I run it from C:\Scheduled_Scripts[System_Maintenance] so basically from a local folder.

    I contacted Synology Support, perhaps they know a solution to this. Until then, this temporary workaround is completely effective.
    I wonder how come you can push scripts onto workstations as SYSTEM when using RMMs like Intune, NinjaOne even tho they, too, are run from a network share... no? @garlin
      My Computer


  4. Posts : 16,953
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #4

    Studynxx said:
    The log files say it runs just fine when I run it from C:\Scheduled_Scripts[System_Maintenance] so basically from a local folder.
    As which user?


    Denis
      My Computer


  5. Posts : 271
    Windows 10
    Thread Starter
       #5

    Try3 said:
    As which user?


    Denis
    As NT AUTHORITY\SYSTEM. The only difference here is that this is a local folder instead of a network share, this time. Network share throws that error code/message tho every other "variable" is the exact same.
      My Computer


  6. Posts : 16,953
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #6

    Then might also running it from Task scheduler in that local folder not provide further data about how you might solve the problem?
    - It would prove your System user approach can work.
    - I think it would reduce the range of causes to just the single one of System user access to the folder the script is in.


    Best of luck,
    Denis
      My Computer


  7. Posts : 271
    Windows 10
    Thread Starter
       #7

    Try3 said:
    Then might also running it from Task scheduler in that local folder not provide further data about how you might solve the problem?
    - It would prove your System user approach can work.
    - I think it would reduce the range of causes to just the single one of System user access to the folder the script is in.


    Best of luck,
    Denis
    Unless I misunderstoood you, I'm already doing that. I'll be waiting on Synology Support's response. Running it as a scheduled task as the SYSTEM user from inside that local directory on the C Drive works flawlessly, just not ideal to me because ideally I'd be able to run all scripts from inside a centralized location such as my NAS file share, but it is what it is
      My Computer


  8. Posts : 16,953
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #8

    OK.
    I thought you had meant it was working when you ran it manually.

    I do appreciate that keeping all the scripts in the same place reduces the maintenance burden and reduces the scope for version-related errors to be made.


    Denis
      My Computer


  9. Posts : 777
    Windows 7
       #9

    Studynxx said:
    I wonder how come you can push scripts onto workstations as SYSTEM when using RMMs like Intune, NinjaOne even tho they, too, are run from a network share... no? @garlin
    Ask @CSharpDev on ElevenForum for help, [they] own the same Synology as you. The exact SAME UNIT.

    Best of luck.
      My Computer


  10. Posts : 271
    Windows 10
    Thread Starter
       #10

    garlin said:
    Ask @CSharpDev on ElevenForum for help, [they] own the same Synology as you. The exact SAME UNIT.

    Best of luck.
    OK I"ll ask them
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 16:15.
Find Us




Windows 10 Forums