Working in Office 365 with PowerShell gives you the option to manage your Online Tenant in a variety of ways, such as the Microsoft Online Directory Services (MSODS), working with users and security groups and Exchange Online (EXO365) for mailboxes, contacts and distribution groups. If you are using an Outbound Internet Proxy Server which requires authentication in order to access the internet, you can use the following approach within your PowerShell commands to properly authentication and establish your connect, to either MSODS or EXO365:
Set the proxyaccesstype and proxyauthentication to the new-pssession variable and then pass the parameter to the new-pssession for connecting to the tenant. This will configure your PowerShell connection to go through your Oubound Internet Proxy server and provide the needed authentication to access your Online Tenant.
As you can see in the first bullet point, the $proxyOption is pulling your Outbound Internet Proxy settings from your Internet Explorer configuration, citing Basic authentication to be used during the connect. In order to use the above information, which are commands to connect into Exchange Online 365, you will need to connect via PowerShell to EXO365. The connection strings are located here: http://help.outlook.com/en-us/140/cc952755.aspx. Note that this information showcases the steps needed to establish a connection, while the below is used to introduce additional parameters/variables, allowing you to work with an Outbound Internet Authenticating Proxy.
- $LiveCred = Get-Credential [enter your GA credentials]
- $proxyOption = New-PSSessionOption -ProxyAccessType IEConfig -ProxyAuthentication basic;
- $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell -Credential $LiveCred -Authentication Basic -AllowRedirection -sessionOption $proxyoption;
- Import-PSSession $Session
The -sessionOption parameter allows you to then bring in the earlier defined $proxyOption variable to connect to your Oubound Internet Proxy server and pass the needed authentication. The rest of the commands are specific to connecting to the EXO365 PowerShell endpoint!
In order to use the above information, which are commands to connect into Exchange Online 365, you will first need to establish