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
  • Posts
  • Replace Your Monitoring Tools with PowerShell
  • SharePoint Migration Elevated: Migration Manager Over SPMT
  • Fix Windows Time Sync with w32tm
  • Diagnose Wi-Fi Drops with Windows' Built-in WLAN Report
  • DESIGN.md: Tell Your AI Agent What to Build, Not Just How to Build It
  • Delete Stubborn Files and Folders on Windows
  • Cut MCP Token Costs 88% with jmunch-mcp
  • Running PowerShell as the Logged-On User from SYSTEM Context
  • Managing Printer Mappings Across User Profiles with PowerShell
  • Automating PowerShell Remoting Setup with Enable-VBPsremoting
  • Automating Azure AD Sync Monitoring Across 155 MSP Clients with PowerShell
Hero Image
Replace Your Monitoring Tools with PowerShell

Task Manager is fine for a live CPU and memory snapshot. What it can’t tell you: why the machine rebooted at 3am, which SSD is quietly wearing out, what auto-start service died last week, or what’s connecting to an unfamiliar IP right now. PowerShell answers all of that — built in, free, scriptable, and more precise than any GUI. No third-party tools, no dashboard. These are diagnostics I run in production, grouped by what they actually solve, so you can go from “something feels wrong” to a root cause in minutes. The live-performance snippets come last on purpose — Task Manager covers that ground well, so the things it can’t do are front-loaded.

  • PowerShell
  • Windows
  • Diagnostics
  • Performance
Wednesday, June 10, 2026 | 9 minutes Read
Hero Image
SharePoint Migration Elevated: Migration Manager Over SPMT

The Point If you still run your SharePoint migrations with the SharePoint Migration Tool (SPMT), Migration Manager is the upgrade worth switching to — same job, far less babysitting.

  • Microsoft 365
  • SharePoint
  • SPMT
  • Migration
Friday, June 5, 2026 | 4 minutes Read
Hero Image
Fix Windows Time Sync with w32tm

Purpose Windows system clock drifting or refusing to sync. This script detects whether the machine is domain-joined and takes the correct NTP path automatically — no manual branching needed. Approach If domain-joined → restore AD hierarchy sync (fighting domain policy with internet NTP is a support ticket waiting to happen) If workgroup/standalone → configure public NTP peers and force resync The Script Run as Administrator: $isDomainJoined = (Get-CimInstance Win32_ComputerSystem).PartOfDomain if ($isDomainJoined) { Write-Host "Domain-joined — syncing from AD hierarchy" -ForegroundColor Cyan w32tm /config /syncfromflags:domhier /update Restart-Service w32time w32tm /resync /force } else { Write-Host "Workgroup machine — configuring public NTP" -ForegroundColor Cyan w32tm /config /manualpeerlist:"time.google.com time.cloudflare.com pool.ntp.org" /syncfromflags:manual /reliable:no /update Restart-Service w32time w32tm /resync /force } If Resync Fails Re-register the Windows Time Service, then re-run the script above:

  • PowerShell
  • Windows
  • Windows Server
  • NTP
  • w32tm
Friday, May 22, 2026 | 2 minutes Read
Hero Image
Diagnose Wi-Fi Drops with Windows' Built-in WLAN Report

Your Wi-Fi drops and you have no idea why. You check the router — it’s fine. Other devices are fine. But your PC dropped three times last night and once during a call. The usual ipconfig and ping checks only tell you what’s happening right now, not what happened while you weren’t watching. Windows has been logging every Wi-Fi connect, disconnect, and error in the background the whole time. One command pulls it into a readable report.

  • Windows
  • Windows Administration
Tuesday, May 19, 2026 | 4 minutes Read
Hero Image
DESIGN.md: Tell Your AI Agent What to Build, Not Just How to Build It

There’s a gap that most AI coding workflows ignore. You tell your agent how to write the code — but you never tell it how the UI should look. The result is functional pages with no coherent style, inconsistent components, and a design that feels assembled rather than considered. DESIGN.md is a plain-text fix for this. Drop one file in your project root and any AI coding agent instantly understands your visual system — colours, typography, component patterns, spacing, the lot.

  • Automation
  • AI
  • Developer Tools
  • Design Systems
Tuesday, May 5, 2026 | 3 minutes Read
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
Hero Image
Automating PowerShell Remoting Setup with Enable-VBPsremoting

What Does Enable-VBPsremoting Do? Managing systems across a network can be time-consuming, especially when dealing with multiple servers or workstations. PowerShell Remoting is a game-changer for system administrators — it allows you to execute commands and scripts on remote machines directly from your admin workstation. However, setting up remoting manually involves several steps: enabling the WinRM service, configuring Windows Firewall rules, and managing trusted hosts. And if you also want to enable Remote Desktop, that’s even more configuration.

  • PowerShell
  • Remote Management
  • Windows Administration
  • Automation
  • WinRM
  • RDP
Wednesday, April 22, 2026 | 6 minutes Read
Hero Image
Automating Azure AD Sync Monitoring Across 155 MSP Clients with PowerShell

Managing Azure AD Connect sync health across a single tenant is straightforward. Doing it across 155+ MSP clients simultaneously — where each has its own Azure AD tenant, its own sync schedule, and its own failure modes — is a different problem entirely. This post covers how I built a monitoring tool that solved this for our team, cutting what used to be a daily manual check into something that runs automatically and only pages us when something actually needs attention.

  • PowerShell
  • Azure AD
  • Automation
  • MSP
  • Active Directory
Sunday, March 22, 2026 | 4 minutes Read
Navigation
  • About
  • Skills
  • Experiences
  • Education
  • Projects
  • PowerShell Modules
  • Articles
  • Recent Posts
  • Accomplishments
  • GitHub
Contact me:
  • vibhu@pwsh.in
  • Facebook: vibhu@pwsh.in
  • Vibhu2
  • Vibhu Bhatnagar
  • +91 8979989222
  • Reddit: VibhuPwsh
  • Twitter: VibhuBhatn54299

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