Monday, October 31, 2016

Expand a VHD/VHDX with Powershell

In the spirit of the "GUI-less" future that Microsoft and other vendors are pushing, I recently removed the GUI from all of our Hyper-V hosts. Now, I know I'm a bit late to the party on this one. I've been cleaning up a lot of things left over from past generations of IT guys, and removing the GUI from our Hyper-V and SOFS hosts just happened to be one of those things.

Last night we received an alert from OpsMan about one of our VMM servers running low on drive space. I figured, "no problem, I'll just pop into Hyper-V Manager and expand the disk". To my dismay, I quickly remembered that I had removed the GUI. "How the heck am I going to expand that disk???", I quietly said to myself.

In comes Powershell...

Using Powershell I was able to expand the disk within seconds! The cmdlet is simple, you just need to know the path to the VHD/VHDX.

Example:

Resize-VHD -Path \\SOFS01\virtualHardDisk.vhdx -SizeBytes 80GB

Then boot the server, open Disk Management, and extend the volume.

Wednesday, October 5, 2016

New Script - Moves All Disabled AD Objects to a Specified OU


The title says it all. This script will move all disabled AD objects to a specified OU. This script accepts parameters that will allow you to specify whether you want to move Users or Computers and the destination OU. It also accepts a "test mode" parameter that will run the script and output the results, without actually modifying Active Directory.

This is revision 1 of the script. There are still several improvements I would like to make, including better error handling and recovery.

If you have any suggestions or requests, please leave a comment.

Download Here

Monday, October 3, 2016

Exchange 2013: Error 0x80070070 While Adding DAG Member



Error: A server-side database availability group administrative operation failed. Error Failed to add or remove the Failover-Clustering feature. Error: The request to add or remove features on the specified server failed. A DISM session could not be opened. An error occurred accessing the temporary folder C:\Windows\TEMP\57ACE2DE-4CD2-4F5F-B7A0-93D867A89A12. Ensure that the path to the temporary folder exists and that you have Read/Write permissions on the folder. Error: 0x80070070



Solution: I was attempting to remotely add the DAG member from the ECP on my workstation. I logged into the server and found that the system drive was nearly full (<100MB free). Luckily this mailbox server was a virtual machine, and I was able to quickly expand the drive using VMM. After doing this I was able to successfully add the mailbox server to the DAG.