<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>SYSTEM on Vibhu Bhatnagar — PowerShell &amp; Infrastructure Engineer</title><link>https://pwsh.in/tags/system/</link><description>Recent content in SYSTEM on Vibhu Bhatnagar — PowerShell &amp; Infrastructure Engineer</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Thu, 23 Apr 2026 12:00:00 +0530</lastBuildDate><atom:link href="https://pwsh.in/tags/system/index.xml" rel="self" type="application/rss+xml"/><item><title>Running PowerShell as the Logged-On User from SYSTEM Context</title><link>https://pwsh.in/posts/invoke-vbascurrentuser/</link><pubDate>Thu, 23 Apr 2026 12:00:00 +0530</pubDate><guid>https://pwsh.in/posts/invoke-vbascurrentuser/</guid><description>&lt;p>If you have ever deployed a PowerShell script through Intune, a RMM agent, or Task Scheduler running as SYSTEM, you have hit this wall at least once: the script works perfectly when you run it interactively, but returns nothing — or the wrong thing — when deployed at scale.&lt;/p>
&lt;p>The reason is almost always the same. The script is collecting user-specific data. And SYSTEM is not the user.&lt;/p>
&lt;hr>
&lt;h2 id="the-problem-system-and-the-user-are-not-the-same-session">The Problem: SYSTEM and the User Are Not the Same Session&lt;/h2>
&lt;p>When Intune or your RMM agent executes a PowerShell script, it runs in the SYSTEM context. SYSTEM is a highly privileged account, but it is completely isolated from the interactive user session happening on the same machine at the same time.&lt;/p></description></item></channel></rss>