Exchange Powershell Commands Missing from EMS
I just performed a fresh install of Exchange 2013 w/ SP1 on Windows 2012 Standard R2 which is also a domain controller in an organization that already has an Exchange 2010 server (on a separate server). When I launch the Exchange Management Shell and attempt
to run "Get-ExchangeServer" I get the error "The term 'Get-ExchangeServer' is not recognized as the name of a cmdlet, function, script file, or operable program..." I see that \\HKLM\SOFTWARE\Microsoft\PowerShell\1\PowerShellSnapIns\Microsoft.Exchange.Management.PowerShell.SnapIn
is loading the module name "D:\Program Files\Microsoft\Exchange\bin\Microsoft.Exchange.PowerShell.Configuration.dll" (which is the correct path to that file).
I've restarted the server twice and have the same issue. Also tried doing an unattended install of just the Managment Tools since using the setup GUI didn't give me the option of uninstalling and reinstalling the Management Tools since the checkbox is greyed
out. I searched the ExchangeSetup log for errors and didn't find any.
How do I get the Exchange Management Shell to register the Exchange Powershell commands? Do I need to uninstall Exchange and Re-Install?
February 18th, 2015 8:22pm
Try running the following in your Exchange Management Shell:
add-pssnapin "exchange" -erroraction silentlycontinue
Then try running your command
February 18th, 2015 8:59pm
Thanks for the reply but unfortunately that didn't solve the problem. The command you specified seemed to work (no errors) but when I try to run any Exchange powershell command "get-exchangeserver", "get-mailbox", etc, I get the same
error message: "The term 'xxx' is not recognized as the name of a cmdlet, function, script file, or operable program."
When I run get-pssnapin it shows:
Name: Microsoft.PowerShell.Core
PSVersion: 4.0
So it seems as though the Exchange PowerShell snapin isn't loading.
Interestingly, "add-pssnapin Microsoft.Exchange.Management.PowerShell.E2010" works but "...E2013" doesn't. I can at least do some basic tasks with this but I would like to get the server functioning properly before I start migrating the
users since I'm sure in the future I will need some Exchange 2013 specific powershell commands.
February 19th, 2015 5:10am
From a remote machine, using a Powershell console started as an Exchange Organization administrator, can you try creating and importing a remote PSSession to the Exchange server ?The steps are detailed
here. After importing the session, try doing a Get-ExchangeServer.
February 19th, 2015 8:11am
Hi Victor,
can you run any command at all?The account you tried to run this command,which Group is it member of?
February 19th, 2015 8:56am
Albert, it looks like Exchange powershell commands work when creating and importing a remote session to the Exchange server. I am able to run Exchange 2013 PS commands (e.g. Get-ExchangeServerAccessLicense, Get-MobileDevice, etc) using this method. Now
the question is, why don't they run locally?
February 19th, 2015 2:55pm
Just to eliminate something simple - doing a 'whoami' inside the local Powershell console on the server indicates the same administrator account that could successfully logon remotely, correct ?
February 19th, 2015 2:58pm
Off2work, yes, other basic (non-Exchange) Powershell commands work. User is a member of Organization Management and is an Enterprise Admin, Domain Admin, and Schema Admin so they should have full rights to everything.
February 19th, 2015 2:58pm
Albert, yes, the same user is logged into both computers (local Exchange server and computer where I started the remote powershell session). Verified with whoami.
February 19th, 2015 4:53pm
please try to add user to Exchange org Admin,log out and back in again to server and try to run command again.Error Message seems like permission issue.
February 20th, 2015 7:19am
As stated above, the user is part of the Organization Management role already, which (unless I'm confused) is the highest-level role I can assign someone to for Exchange 2013.
February 20th, 2015 11:51pm
Added user to Server Management role and there is no change. Still cannot access the Exchange shell commands from the Exchange Management Console.
Sorry for the lag in response, I'm not getting the alerts that there is a reply.
February 23rd, 2015 4:54am
did you log out and back in again on the server after you added Group?
February 23rd, 2015 10:50am
Yes. Still cannot access the Exchange shell commands.
February 26th, 2015 6:17pm
I don't think we set up split permissions in the domain/Exchange environment (unless I did it inadvertently). And there's nothing that says that installing Exchange on a domain controller makes it so that you can't use Exchange commands in the Exchange
Management Console locally. That seems like something else entirely.
March 5th, 2015 4:39pm
Try below and confirm if that works.
1. Close Exchange Management Shell
2. Start -> Run -> %Appdata%
3. Open Roaming => Microsoft => Exchange => RemotePowershell
4. Delete or rename thethe folder which will have the nam equal to your Exchange server server1.domain.com
5. Open Exchange Management Shell and wait for the RBAC Stack authorization to complete where cmdlet will be added.
***VOTE IF HELPFUL / MARK ANSWER IF ANSWERS ***
March 5th, 2015 8:24pm
PK M, sorry, that didn't work either. I still can't run Exchange commands locally. Verified that re-launching the EMS created a new entry with my server name in \Microsoft\Exchange\RemotePowershell.
March 5th, 2015 8:29pm
Open Powershell as Administrator.
1. Add-Pssnapin *Setup*
2. Install-CannedRbacRoleAssignments -InvocationMode Install -verbose
3. Install-CannedRbacRoleAssignmentSRAP -InvocationMode Install -verbose
4. Install-CannedRbacRoles -InvocationMode Install -verbose
Try the above commands and let me know if that helps
if that doesn't can you run the below command reply back with the output
Get-Command |?{$_.Name -like "Get-Exchange*"}
***VOTE IF HELPFUL / MARK ANSWER IF ANSWERS ***
March 5th, 2015 8:50pm
Ran the commands above. Steps 1 and 2 worked fine. Steps 3 and 4 were unrecognized commands. Still can't run Exchange commandlets.
Here is the output of Get-Command |?{$_.Name -like "Get-Exchange*"}:
CommandType Name ModuleName
----------- ---- ----------
Cmdlet get-ExchangeServerGroupSid Microsoft.Exchange.Management.PowerShell.Setup
March 5th, 2015 11:16pm
this works for me.
July 8th, 2015 4:12am
I checked out that article you linked but unfortunately it's not the same issue. When I run "get-pssnapin -registered" I get the following list:
Name : EnginePSSnapin
PSVersion : 2.0
Description : Register cmdlets for Content Engine
Name : HostControllerPSSnapIn
PSVersion : 2.0
Description : Register cmdlets for Host Controller
Name : InteractionEnginePSSnapIn
PSVersion : 2.0
Description : Register cmdlets for InteractionEngine
Name : JunoPSSnapin
PSVersion : 2.0
Description : Register cmdlets for Juno
Name : Microsoft.Exchange.Management.PowerShell.E2010
PSVersion : 1.0
Description : Admin Tasks for the Exchange Server
Name : Microsoft.Exchange.Management.PowerShell.Setup
PSVersion : 1.0
Description : Setup Tasks for the Exchange Server
Name : Microsoft.Exchange.Management.PowerShell.SnapIn
PSVersion : 1.0
Description : Admin Tasks for the Exchange Server
Name : Microsoft.Exchange.Management.Powershell.Support
PSVersion : 1.0
Description : Support Tasks for the Exchange Server
Name : Microsoft.Forefront.Filtering.Management.PowerShell
PSVersion : 2.0
Description : Microsoft Forefront Filtering PowerShell Interface
Name : SearchCorePSSnapIn
PSVersion : 2.0
Description : Register cmdlets for SearchCore
Also when I look at the registry, all of the keys that should exist do exist
July 8th, 2015 12:14pm
Victor, what happens if you build a PSSession and import it from within the local machine itself, using the
same procedure used earlier to connect remotely. Depending on the outcome, it might hint where to look next. Should this test be successful, it might be pointing to issues with the EMS shortcut invoking RemoteExchange.ps1.
July 9th, 2015 3:20am