Execute CustomAction as a particular user #8678
-
Per the title, I need to perform an action during setup as a particular user. Is that possible? I know that I can run commands either as the installing user or as LocalSystem but this doesn't work for me. I unfortunately need to run something as a particular service user for setup. The service user is a managed virtual account created along with the service which complicates it even further as I can't just invoke a runas command as far as I understand. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I don't believe this is possible in the Windows world. The first two options require Windows Server, and some setup (normally using PowerShell). The last 'Virtual Accounts' is tied specifically to the name of a Service (configured in the Windows Services list). Nothing else can authenticate as this account. Only the appropriately named service (it does a Service Name -> SID mapping using a SHA1 hash and fixed prefix apparently... so I guess a hash collision could occur) The other two options should be possible. But I don't think a plain Virtual Account can be impersonated (at least not without excessive weirdness.. finding the SID, creating a service with a name to force that SID collision (which might even be prevented with Windows OS refusing to create a service with a conflicting SID to an existing service).... blurgh. |
Beta Was this translation helpful? Give feedback.
I don't believe this is possible in the Windows world.
There are three service account types (excluding a normal user account being used, not recommended)
The first two options require Windows Server, and some setup (normally using PowerShell). The last 'Virtual Accounts' is tied specifically to the name of a Service (configured in the Windows Services list). Nothing else can authenticate as this account. Only the appropriately named service (it does a Service Name -> SID mapping using a SHA1 hash and fixed prefix apparently... so I guess a hash collision could occur)
https://www.1e.com/blogs/accounts-ev…