Missing some cmdlets at Exchange Management Shell? Me too!

11 11 2010

On one of our many Exchange Servers at work, I recently discovered the Exchange cmdlets in the Management Shell which I rely on for my daily Exchange management had disappeared. get-excommand reported just one Exchange cmdlet was loaded: Get-ExchangeDiagnosticInfo. Strange. They were there one day, gone the next. No, it wasn’t caused by an update to the best of my knowledge; it didn’t happen over our patching window.

The case of missing cmdlets was traced back to an issue with my user profile on this server. A test with another user account yielded no issues at the Management Shell.

A quick fix to this might be to obliterate the user profile using the System applet Control Panel, then log back in and have Windows generate a new profile. However, this is totally unnecessary and you’ll lose any special configuration, given how simple the actual solution is.

Exchange Management Shell uses a directory in the user’s roaming Application Data to store the Powershell module configuration settings. My module data had some… modifications. I don’t know the source of these changes, but it rendered the cmdlets missing. I suspected this was the case because shell loaded much more quickly than normal when it was broken – rather than show the status of the pending implicit remoting session, which I am used to seeing, it loaded and connected almost instantaneously.

The solution is to remove the C:\Users\username\AppData\Roaming\Microsoft\Exchange\RemotePowershell\your.domain.com directory.

After deleting this directory, restart the Shell. The startup process will create the directory and re-generate the module files, fixing your issue and allowing you to get on with whatever you needed to do!


P.s. I know I’ve been quiet lately, and for that, I apologise. For the past couple of months I’ve been involved in an almighty migration job, away from an awful managed service network (tip: NEVER opt for an outside company to supply your network. It falls apart!) to a vanilla Windows Server system. This came not a moment too soon but completing a migration of this magnitude for 2500 seats in the 6 week maintenance window is no easy feat!

I do have some articles on the backburner, and hope to get some out to you ASAP. Thanks for your patience, and thanks for reading!




6 responses

29 06 2011

Wow. This fix just saved my bacon. Glad I managed to find it while searching on the web. I was having this same exact problem with my own account, but only on a single server. Your fix worked exactly as described and took care of the problem. Thanks for taking the time to share it.

-a fellow “Matt”

31 08 2011

Worked great for me too.

I was trying to add:

Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010
. $env:ExchangeInstallPath\bin\RemoteExchange.ps1
Connect-ExchangeServer -auto

to my Powershell profile after installing the exchange tools to allow me to use exchange commands in the standard shell (as opposed to the Exchange Management Shell) and that seemed to be the cause of my issue.

I was able to add the above to the ISE profile just fine to get exchange cmdlets in the ISE without any issues. Guess I’ll just have to run exchange cmdlets from teh exchange shell or the ISE.


30 11 2012

Worked great – thanks millions – it was very frustrating

9 01 2013
Jeremy L

Thank you!

5 03 2013

Spot on, thank you!

16 07 2013
Eric H

Thank you so much for this post you saved my arse!!

I don’t know why this happens though which really bothers me. I have to delete this folder about once a week to ensure the mailboxes are all exported. It’s so annoying.

I’m just going to write a script to delete this once a day!!

I wonder if this happens because I am using a regular user account to schedule my script to run instead of the SYSTEM account???

Any thoughts?


%d bloggers like this: