There are plenty of posts on the interweb that show you how to mount and unmount vhds via powershell. I downloaded the Hyper-V PowerShell management library from CodePlex.com here as created by James O’Neil. In it he kindly provides two scripts (mount-VHD.ps1 and Unmount-VHD.ps1) along with a REG file. Assuming you have PowerShell 1.0 installed (available feature in…
Tag: Scripting
Scripting: Check if a W2K3 box is running Terminal Server in Application Mode
I was recently asked (two hours ago) how to tell if a server was running Terminal Services in Application Mode. The customer wanted to run a different script if users were logged into a Terminal Server. They had looked through the registry and came across the TSEnabled value in : HKLM\Software\System\CurrentControlSet\Control\Terminal Server While this key…
Scripting: How to edit an INI file from a script
I was asked how to modify an INI from a script. Its quite straight forward. Firstly have a read of the Scripting Guy article here. It explains the process quite well actually. However, I wanted to go a step further and setup arguments to make the script re-useable. So here is the modified script: ‘Usage:…
Batch Files : Date Stamp in a filename
Ive been asked this a number of times this past month…. How do I get the date into a filename in a batch file? Most people try using the %date% variable. Which will not work as you cannot have /’s in the filename. So, try this: for /f “tokens=1-4 delims=/ ” %%i in (“%date%”) do…
Windows 2000 Terminal Server : Modify RDP-tcp permissions via script
I was recently asked how to modify the rdp permissions on a large number of Windows 2000 SP4 servers running in Remote Admin mode. Well, normally Id make use of WMI and make the changes using Win32_TSPermissionsSetting class. Unfortunatly this class is not available in Windows 2000. To get around this issue in Windows 2000…