After a fresh installation of Exchange 2007, the Exchange Management Shell may be found very sluggish. This is because of a damaged configuration setting during installation. The script below boosts the performance of the EMS startup dramatically.
To run the script, do the following:
Open Notepad, paste the following script and save the file as “speedup-ems.ps1”
Set-Alias ngen @(
dir (join-path ${env:\windir} “Microsoft.NET\Framework64”) ngen.exe -recurse |
sort -descending lastwritetime
)[0].fullName
[appdomain]::currentdomain.getassemblies() | %{ngen $_.location}
Open the Exchange Management Shell, navigate to the location where you saved the speedup-ems.ps1 and type:
.\speedup-ems.ps1
In most cases you will not have the appropriate rights to run the script, because it is unsafe. To run the script, you should first edit the ExecutionPolicy. Type the following in the EMS:
Set-ExecutionPolicy Unrestricted
This allows you to run every script. This may be unsafe, but it is very handy in test environments. 🙂
You may not have sufficient rights to run the Set-ExecutionPolicy command. If this is the case, close Powershell, and run it again by rightclicking on the shortcut and select ” Run as Administrator”. Then execute the command again.
After all this, the EMS should start a lot faster than it did before!