Warning
This project is under development and is not production-ready. APIs may change without notice.
PSUserContext is a compiled PowerShell module designed to execute commands within different user contexts.
A user context refers to a Windows terminal session — for example, the local console session or any active Remote Desktop (RDP) session.
This module provides fine-grained control over executing processes and scripts as specific users, making it useful for system administration, automation, and remote management scenarios.
System or RMM tasks often run under the SYSTEM account and can’t directly interact with the logged-on user’s environment.
With PSUserContext, you can trigger user-specific updates such as:
Get-UserContext -Console | Invoke-UserContext -ScriptBlock {gpupdate /target:user /force}- Deserialized output with interactable objects
- Asynchronous batch execution across multiple sessions
- Centralized and structured logging
Special thanks to KelvinTegelaar for the foundational work that inspired this project and helped shape its direction.