SOLVED

connecting to exchange 2013 permanently

%3CLINGO-SUB%20id%3D%22lingo-sub-2028819%22%20slang%3D%22en-US%22%3Econnecting%20to%20exchange%202013%20permanently%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2028819%22%20slang%3D%22en-US%22%3E%3CP%3EEverytime%20i%20start%20Powershell%20on%20my%20admin%20pc%20and%20want%20to%20run%20cmdlets%20to%20exchange%20server%20the%20Exchange%20connection%20must%20be%20made.%3C%2FP%3E%3CP%3EFor%20that%20i%20load%20the%20following%20every%20time%3A%3C%2FP%3E%3CP%3E%24Session%20%3D%20New-PSSession%20-ConfigurationName%20Microsoft.Exchange%20-ConnectionUri%20http%3A%2F%2Fexchangeserver%2FPowerShell%2F%20-Authentication%20Kerberos%3C%2FP%3E%3CP%3EImport-PSSession%20%24Session%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20it%20possible%20to%20connect%20to%20it%20automatically%20when%20i%20start%20powershell%20on%20a%20non-exchange%20server%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2028819%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExchange%202013-session-from-client%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2029834%22%20slang%3D%22en-US%22%3ERe%3A%20connecting%20to%20exchange%202013%20permanently%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2029834%22%20slang%3D%22en-US%22%3E%3CP%3EPut%20those%20cmdlets%20in%20your%20Profile%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fmicrosoft.powershell.core%2Fabout%2Fabout_profiles%3Fview%3Dpowershell-7.1%23how-to-edit-a-profile%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fmicrosoft.powershell.core%2Fabout%2Fabout_profiles%3Fview%3Dpowershell-7.1%23how-to-edit-a-profile%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Everytime i start Powershell on my admin pc and want to run cmdlets to exchange server the Exchange connection must be made.

For that i load the following every time:

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://exchangeserver/PowerShell/ -Authentication Kerberos

Import-PSSession $Session

 

Is it possible to connect to it automatically when i start powershell on a non-exchange server?

2 Replies
Best Response confirmed by corne2010 (New Contributor)

@Vasil Michev ,

 

Thanks, that did the trick!