Page 1 of 1

How do I load the Exchange Management Shell via Powershell Studio 2015 (Remote Session)?

Posted: Fri Jan 15, 2016 9:27 am
by vanhalo
How do I load the Exchange Management Shell via Powershell Studio 2015 (Remote Session)?

Re: How do I load the Exchange Management Shell via Powershell Studio 2015 (Remote Session)?

Posted: Sat Jan 16, 2016 8:29 pm
by jvierra
I am not aware that there are any "Best Practices"

It is not clear why you ask this. Remotely you have to import the modules. Locally you can d either. It is your choice.

PowerShell Studio says nothing about how to use PowerShell. PSS is just an editor and development tool. PowerShell is the decider in all cases

Re: How do I load the Exchange Management Shell via Powershell Studio 2015 (Remote Session)?

Posted: Sat Jan 16, 2016 8:32 pm
by jvierra
Yu don't load the shell. Just remote into Exchange.

Code: Select all

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://<FQDN of Exchange 2016 Mailbox server>/PowerShell/ -Authentication Kerberos -Credential $UserCredential
Remove-PSSession $Session

Re: How do I load the Exchange Management Shell via Powershell Studio 2015 (Remote Session)?

Posted: Thu Feb 04, 2016 7:22 am
by vanhalo
jvierra wrote:Yu don't load the shell. Just remote into Exchange.

Code: Select all

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://<FQDN of Exchange 2016 Mailbox server>/PowerShell/ -Authentication Kerberos -Credential $UserCredential
Remove-PSSession $Session
What is the purpose of importing the remote cache (CacheExport.zip) in this scenario? AKA Exchange

When I use a SharePoint server (importing the cache file) I can add the remote snapin using only the remote cache configuration.

Example:

Add-PsSnapin Microsoft.SharePoint.Powershell

Get-Command -Module Microsoft.SharePoint.PowerShell | Out-File d:\psscripts\SP2013Commands.txt

It seems to me that importing remote cache (when it comes to dealing with Exchange and the Exchange Shell) is of no use because by using the following:

$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://servername/PowerShell/ -Authentication Kerberos -Credential $UserCredential
Import-PSSession $Session



I am confined to running this script via a local machine connection as I would without Powershell Studio 2015.

I am new to this so maybe I missing something here.

I would prefer to use the Remote Cache feature for Exchange.

Re: How do I load the Exchange Management Shell via Powershell Studio 2015 (Remote Session)?

Posted: Thu Feb 04, 2016 7:28 am
by jvierra
Using the cache only gives you the intellisense. If the management tools are not installed locally then you cannot add the snap-in. If they are installed locally then you do not need to import the remote cache.

In a remote session you can either enter the session and type commands or attach to the session and use Invoke. We can import the session and it will mostly appear to be local but objects will behave somewhat differently.

Re: How do I load the Exchange Management Shell via Powershell Studio 2015 (Remote Session)?

Posted: Thu Feb 04, 2016 7:34 am
by jvierra
I should note that the way Exchange works is very different from many subsystems.

https://technet.microsoft.com/en-us/lib ... .160).aspx