For security, scheduled tasks are split between SYSTEM and USERS (principals). I want to protect a password string. My goal is for a PowerShell task running under the SYSTEM principal to send plaintext or encrypted information to a process running under a user account.
I have identified two options: shared memory and message passing. Currently I am using System.IO.MemoryMappedFiles with PowerShell. There are several modules available.
If I test by running PowerShell ISE as Administrator and an additional shell as a user account, I can transfer data—strings, JSON objects, etc. It works well.
However, when I do the same using a Windows scheduled task, it does not work. It seems SYSTEM can allocate memory and write to it (no error message), but when I try to read the shared memory object, it says something like “does not exist”.
Is this behavior by design? How can PowerShell processes running under the SYSTEM principal context securely share information with processes running as USERS? Is it possible to do this using System.IO.MemoryMappedFiles?
Thanks. Maik