Hyper-V, Resources, Scripting, Virtualization, Windows
Leave a comment

Removable drive notification Script for Server Core / Hyper-V Server 2008

I like the Windows Server Core OS for its foot print and performance compared to a full blown OS. You can enable what you want and get rid of everything else. The same holds good for Hyper-V Server 2008 as well. However, working with this stripped-down OS can be a real pain. Escpecially, when you connect a removable device like a flash key, there is no notification of the drive letter getting assigned to it, etc. On a full-blown OS, this isn’t a problem as we have the explorer process taking care of showing the notifications.

Coming to the subject of this post, I have been using this script for getting notifications for USB key add/remove events. This script runs in the background and notifies the removable storage events.

Install Instructions
1. Download the zip from here
2. Unzip the contents to C:\scripts folder
3. Open Registry Editor from command-line
4. Navigate to HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon and change the value of “Shell” to “cmd /c c:\scripts\InitLogon.bat”

That is it. Next time onwards, whenever you login to the Server Core system, USB_Notify.VBS will start running in the background and pop-up a message whenever a removable device is added or removed. Hope this is helpful.

Filed under: Hyper-V, Resources, Scripting, Virtualization, Windows

by

Ravikanth is a principal engineer and the lead architect for Microsoft and VMware virtualized and hybrid cloud solutions within the Infrastructure Solutions Group at Dell EMC. He is a multi-year recipient of Microsoft Most Valuable Professional (MVP) award in Windows PowerShell (CDM) and Microsoft Azure. Ravikanth is the author of Windows PowerShell Desired State Configuration Revealed (Apress) and leads Bangalore PowerShell and Bangalore IT Pro user groups. He can be seen speaking regularly at local user group events and conferences in India and abroad.