Author Posts

September 17, 2015 at 12:53 am

Hi there,

I am currently working to build up several tools my daily work tasks. And there's one I've been avoiding, because I just have no idea how to approach it, and whether PowerShell is the language I should be using.

Reconfiguring outlook profiles to Office 365. It's totally possible with on-premise, using a .prf, but with autodiscover, the server name is dynamic, so hard coding in a server name is not possible. I find this crazy that I can't figure this out as I would expect it to be something the Office 365 team would want to make it possible.

I have managed to design a tool which creates a share, downloads 365 to it, deploys a GPO to the client with a customisable icon appearing on desktops, which can uninstall any version of office and re-install the new one, while displaying a beautiful little progress bar, but I can't make a script which utilizes autodiscover.. driving me crazy a bit!

Please let me know if anyone else has faced this issue and any ideas would be much appreciated!

Many Thanks,

September 17, 2015 at 1:40 am

$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session

The key to this is the -AllowRedirection switch so you can go from the generic front door to the specific server for you.

September 17, 2015 at 2:12 am

Hi Bob,

Thank you for your response.

I know this would work to login to Exchange Online to configure the tenant, but surely this is a connection to the tenant administration, rather than the creation of an outlook profile which uses Office 365 AutoDiscover?

Are you suggesting I investigate how the -AllowRedirection switch has been built, and utilise it for what I'm looking at?

September 18, 2015 at 12:12 am

Hi Bob, you were right, all the information I needed was there inside the Exchange Session connection...

Thanks for pointing me in the right direction.

September 18, 2015 at 9:09 am

Glad that worked for you. Have a good weekend.