Well its not exchange related but I run all my labs in hyper-v and I recently wanted to compress all the dynamic disks in my hyper-v lab and me being lazy did not want to go to the options on EVERY VM to compress the drives, so I started my google search to find a Powershell script to do them all for me…… well I couldn’t find it so I made one of my own and figured I would share [:-)]

FYI- you need SCVMM to run this

Get-VMMServer -ComputerName localhost -TCPPort 8100 (8100 is default)

get-vm | where {$_.status -eq “POwerOFf”} | Get-VirtualDiskDrive |where {$_.status -eq “POwerOFf”}| ForEach-Object {Compress-VirtualDiskDrive -RunAsynchronously -VirtualDiskDrive $_}

Note: this will compress everything that’s “shutdown” so make sure you have the Disk I/O to do this.

[http://feeds.wordpress.com/1.0/comments/exchangemaster.wordpress.com/208/] [http://feeds.wordpress.com/1.0/delicious/exchangemaster.wordpress.com/208/] [http://feeds.wordpress.com/1.0/stumble/exchangemaster.wordpress.com/208/] [http://feeds.wordpress.com/1.0/digg/exchangemaster.wordpress.com/208/] [http://feeds.wordpress.com/1.0/reddit/exchangemaster.wordpress.com/208/] [http://stats.wordpress.com/b.gif?host=exchangemaster.wordpress.com&blog=10618152&post=208&subd=exchangemaster&ref=&feed=1]


Posted via email from johnacook’s posterous