Logo Vibhu Bhatnagar — PowerShell & Infrastructure Engineer
  • Home
  • About
  • Skills
  • Experiences
  • More
    Education Projects PowerShell Modules Articles Recent Posts Accomplishments
  • Posts
  • Notes
  • Hire Me
  • GitHub
  • Dark Theme
    Light Theme Dark Theme System Theme
Logo Inverted Logo
  • Tags
  • Active Directory
  • AI
  • AI Tools
  • Automation
  • Azure AD
  • Design Systems
  • Developer Tools
  • GPO
  • Intune
  • MCP
  • Module
  • MSP
  • PowerShell
  • Printers
  • RDP
  • Registry
  • Remote Management
  • RMM
  • Sysadmin
  • SYSTEM
  • Windows
  • Windows Administration
  • WinRM
Hero Image
Delete Stubborn Files and Folders on Windows

What This Covers You have a file or folder that won’t delete — Access Denied, locked by the system, or held open by a running process. This covers three methods to force-delete it: Command Prompt, PowerShell, and scheduling deletion at next boot using Task Scheduler with SYSTEM rights. Before You Start Run everything as Administrator — right-click CMD or PowerShell → Run as administrator Set the path variable at the top of each method — everything else uses it This is irreversible. Double-check the path before you run anything These methods bypass permission locks — use only on files you own or manage Steps Method 1: Command Prompt set TARGET=C:\path\to\locked-folder takeown /F %TARGET% /R /A icacls %TARGET% /grant Administrators:F /T rd /S /Q %TARGET% For a single file, replace the last line with:

  • PowerShell
  • Windows
  • Windows Administration
Tuesday, April 28, 2026 | 4 minutes Read
Hero Image
Cut MCP Token Costs 88% with jmunch-mcp

Introduction If you run Claude Desktop, Claude Code, or any MCP-enabled client through the day, you are burning tokens you never asked for. Every MCP server call that returns a large payload — GitHub issues, Firecrawl scrapes, search results — dumps the entire response into context whether your agent needed three lines or three hundred thousand tokens worth of data. jmunch-mcp is a transparent MCP proxy that sits in front of your existing MCP servers and fixes this without changing anything about how you work.

  • Automation
  • Windows
  • AI Tools
  • MCP
Friday, April 24, 2026 | 5 minutes Read
Hero Image
Running PowerShell as the Logged-On User from SYSTEM Context

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. The reason is almost always the same. The script is collecting user-specific data. And SYSTEM is not the user. The Problem: SYSTEM and the User Are Not the Same Session 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.

  • PowerShell
  • Intune
  • RMM
  • GPO
  • SYSTEM
  • Module
  • Sysadmin
  • Windows
Thursday, April 23, 2026 | 6 minutes Read
Hero Image
Managing Printer Mappings Across User Profiles with PowerShell

Printer management at scale is one of those problems that looks trivial until you are staring at 200 workstations, each with multiple user profiles, each with their own mapped printers, and a print server migration starting in two days. Doing it manually is not an option. Doing it via Group Policy works for connected machines but breaks for laptops on VPN, offline profiles, and anyone who mapped printers manually outside GPO. What you actually need is something that understands how Windows stores printer mappings per user, can work on both online and offline profiles, and can be deployed from your RMM in a single script run.

  • PowerShell
  • Printers
  • Windows
  • Module
  • Registry
  • RMM
  • Sysadmin
Thursday, April 23, 2026 | 13 minutes Read
Navigation
  • About
  • Skills
  • Experiences
  • Education
  • Projects
  • PowerShell Modules
  • Articles
  • Recent Posts
  • Accomplishments
  • GitHub
Contact me:
  • vibhu@pwsh.in
  • Vibhu2
  • Vibhu Bhatnagar
  • +91 8979989222

Liability Notice: The views and opinions expressed on this blog are my own and do not represent those of my employer. All content is provided for informational purposes only.


Toha Theme Logo Toha
© 2026 Vibhu Bhatnagar. All rights reserved.
Powered by Hugo Logo