Remove autodiscover from Exchange 2010 after migrating to Office 365

This is just a 100% copy from this excellent blog as a note for myrself. :


Enable Office 365 Auto-discover for Outlook in SBS 2011 Exchange Environments

One of the  issues you will run into when migrating from an on premises Exchange 2010 server on SBS 2011 is that Outlook will not autodiscover the correct Office 365 server settings. Fortunately this can be easily solved with a few simple PowerShell commands.

  1. Open an Exchange Management Shell as an administrator. (Elevated PowerShell)
  2. Use the following command to discover the Identity name of your Autodiscover Virtual Directory. Either note or copy the values in the Identity field.
    Get-AutodiscoverVirtualDirectory | fl Name, Server, InternalUrl, Identity
    Retrieve Exchange Autodiscover Virtual Directory Settings - SBS 2011
  3. Use the following command to remove the AutoDiscover Virtual Directory. Be sure to replace the text inside the quotes with the value in the Identity field above.
    Remove-AutodiscoverVirtualDirectory –Identity “Insert identity value here”
     Virtual Directory for Exchange 2010
  4. You will have to confirm the removal by hitting Y for yes when prompted. You can double check to see if this worked properly by rerunning the command in step 2.  You should get a blank result if successful.

That should be it. Your Outlook clients should connect successfully to the Office 365 service.


c:windowssxs folder is growing large

You should never delete the files inside this folder manually;

instead, if you are running service pack 1 of Windows Server 2008 R2 or Windows 7 you can use this command to cleanup the backup files of the service pack installation

You can also check this website from Microsoft with other utilities, f.eks. disc cleanup:

DISM /online /Cleanup-Image /SpSuperseded

How to kill a stucked VM in Hyper-V 3.0

From time to time you may have a VM which is not responsive in both the guest OS but also that it wont shutdown/restart on the hyper-v host AND it can also be in a stopped starte which really wont let you manage the vm anymore.

A running VM is just a little process on the host called vmwp.exe. There is one such process for each VM and to find the correct GUID (the unique identificatior) you will have to go into your folder where your virtual machine is located. The folder name and/or the name of the .xml file with the configuration is named with this GUID. Then you can just open task manager, locate the vmwp.exe process and the corresponding GUID; right click and end process. The virtual machines is now ok to be restarted again.



Free space on your Windows Deduplicated volume

In Windows 2012 R2 you can enable deduplication on a volume. This can save tons of space and I use lit a lot when I save f.eks Veeam backup files. You can easy get a saving of 50-70% of your avaiable space.

An «issue» though; if you want to delete some files and get your space back, you will have to wait for a week… ( ) Look at the Garbage collection part…

You can alse see this by typing the following in powershell:


Here yu can see the garbagecollection is set to run weekly at Saturday 02:45

There is a workaround if you want to get your space back sooner; run this powershellscript where D: is the letter of yuour deduplicated volume:

Start-DedupJob -Type GarbageCollection -Priority High -Volume D:

You can even schedule this job to run f.ex once a day if you want to get your space back at a daily level:

Set-DedupSchedule –Name "FreeSpace" –Type GarbageCollection –Start hh:ss –DurationHours 5 –Days Mon,Tues,Wed,Thurs,Fri,Sat,Sun –Priority High

Replace hh:ss with the time you want to perform the job, also remove unwanted days if not needed.


Install Veeam Endpoint Backup FREE


[ezcol_1half_end]First of all, head over to and download the software. Its appx. 175MB. and you will need to register with an emailadress and password. Unzip the file and start setup.exe[/ezcol_1half_end]





[ezcol_1half_end]Accept the Agreement and click Install[/ezcol_1half_end]



[/ezcol_1half] [ezcol_1half_end]The installation starts and will install all necessary files. Grab a nice cup of coffee and wait a couple of minutes to let the installation finish.[/ezcol_1half_end]


[/ezcol_1half] [ezcol_1half_end]For most people, stick to the recommended settings and let Veeam autoconfigure it for you. As an IT-professional I always want to know what it is going on in the background so I prefer to skip the autosettings and configure it manually. I choose «Skip this, I will configure backup later». You should also do this if you want to backup to other media f.ex NAS etc.[/ezcol_1half_end]



[/ezcol_1half] [ezcol_1half_end]The wizard want you to create a recovery disc which you can use to restore your computer in a bare metal restore. I suggest that you do this. Or at least create an .iso file which you can use to create the disc later with the hardware drivers. [/ezcol_1half_end]


[/ezcol_1half] [ezcol_1half_end]The recovery wizard will scan for USB-devices you can use. In my case I am running this installation in a virtual machine so I have not connected an USB-device. Choose your appropriate target and click next to create the .ISO file. Keep the default settings if you not have a special reason NOT to.[/ezcol_1half_end]


[/ezcol_1half] [ezcol_1half_end]Veeam will run in the background and you can change the backupsettings by access the icon in your systray. I prefer to set this icon always visible.[/ezcol_1half_end]


[/ezcol_1half] [ezcol_1half_end]Since I skipped the autosetup with USB, I must create a job first. I always choose «Entire Computer (recommended)» I suggest you do the same thing if you not are 100% aware of what you are doing. The other options is well explained in the wizard.[/ezcol_1half_end]


[/ezcol_1half] [ezcol_1half_end]In the next window you can choose which media you want to store your backup media. I will in another post show to integrate the VEB-backup into a Veeam Backup & Replication repository from an administrator perspective. [/ezcol_1half_end]


[/ezcol_1half] [ezcol_1half_end]Choose your local drive Usb, network etc. and set your preferred backup retention. Default is to keep backup for 14 days. The first backup will always be full then forever incremental no matter what repository you choose.[/ezcol_1half_end]


[/ezcol_1half] [ezcol_1half_end]Set the time when you want your backup to kick off. You can also trigger the backup at special events such as when your computer get locked or when you are logging off for the day or even when the USB-device is connected. Press Create and your are done![/ezcol_1half_end]

Host not responding in VMM 2012 SP1 with 2012 hyper-v hosts

I noticed this weekend that one host in a Windows 2012 Failover Cluster showed «host not responding» in the statuswindo in VMM 2012. The VMs running on the host worked just fine and we could managed the VMs through both Hyper-V manager and Failover Cluster msc.

The event viewer on the host showed error 3001 very often (every half min. or even more often).

This error has to do something with WMI so I guess this had to do with the Performance Counter not giving the info to VMM.

I came over a nice blog (please send me the link again for reference!) which showed me how to reset the performance counter

open an eleveted cmd.exe promot and go to c:windowssyswow64

There you can run the following command (you must have navigated to the c:windowssyswo64 directory or else you will get an error with error code 2 saying you can’t restore from a system restore backup)

lodctr /R

After that you must run the following command to sync the information, important!

winmgmt.exe /RESYNCPERF

How to reclaim space in .vhdx files and shrink disc

The Problem

You have a 250GB VHD Dynamic VHD file which has eaten too much of your Hyper-V host’s drive space (WSUS Instances come to mind).   You have accessed the virtual machine and deleted/removed the unwanted bloat that occurs over time.  But, you still can’t shrink the .VHD file on the host server.

The Solution

Simply deleting or otherwise removing files from your virtual machine’s drive does not allow the VHD to be shrunk.  You must “Zero Out” the unused sectors so Hyper-V can reclaim the space. Remember this wil max out the capcity of the .vhdx files so you wil need to have enough space on your host.


The How To

  1. Download Secure Delete from Microsoft onto the Virtual Machine
    Important: Remember to unzip the file to an easy to access location.
  2. Open a Command Prompt
    Important: Remember to launch as Administrator!
  3. Execute SDelete as follows (where [path] is the located you unzipped the file)
    [PATH]sdelete –c -z
  4. Accept the terms and let it run
  5. Wait….
  6. Shutdown the virtual instance
  7. Launch Hyper-V Manager on the host server
  8. Open up the setting panel for the Hyper-V instance you wish to perform a VHD shrink for.
  9. Select the drive you wish to compact and click Edit
  10. Select Compact and click Finish
  11. Wait…



Delete all the items in a maibox in Exchange 2013

I imported an .pst into the wrong mailbox (but before I gave the credential to the user..) and with 25.000 emails this was not something I would want to do in Outllok with hang etc…

So how can I do this directly on the Exchange 2013 server? Easy! With a one-line in powershell!

But you have to give your administrator the Mailbox Search role and Mailbox Import Export in the ECP. Look at this wonderful blog on how you do that first:

So how do I delete the content with a one liner?

Search-Mailbox -Identity «name of mailbox» -DeleteContent -Force

What we do is basically doing a search in the mailbox without filtering and delete the results. With this approach you can lso filter certain elements and just delte them.

F.ex if you just want to delete all calendar entries in a mailbox:

Search-Mailbox -Identity «name of mailbox» –SearchQuery kind:meetings –DeleteContent

You can also show the estiates on what would be deleted without actually deleting anything by adding –EstimateResultOnly at the the end:

Search-Mailbox -Identity «name of mailbox» –SearchQuery kind:meetings –DeleteContent –EstimateResultOnly

Fore more specific filter, look at this blog which is also the source for my blog:




Blogg på

opp ↑