# Am I reaching the limits of PowerShell here?

**URL:** <https://forums.powershell.org/t/am-i-reaching-the-limits-of-powershell-here/4895>\
**Category:** PowerShell Help\
**Created:** [September 16, 2015, 7:23pm UTC](https://forums.powershell.org/t/am-i-reaching-the-limits-of-powershell-here/4895 "2015-09-16T19:23:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![steven-ayers](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@steven-ayers](https://forums.powershell.org/u/steven-ayers)\
**Post date:** [September 16, 2015, 7:23pm UTC](https://forums.powershell.org/t/am-i-reaching-the-limits-of-powershell-here/4895/1 "2015-09-16T19:23:28Z")

</div>

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,  
Steven

---

<div class="post-metadata">

**Author:** ![bobmccoy](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/bobmccoy/32/650_2.png) [@bobmccoy](https://forums.powershell.org/u/bobmccoy)\
**Post date:** [September 16, 2015, 8:10pm UTC](https://forums.powershell.org/t/am-i-reaching-the-limits-of-powershell-here/4895/2 "2015-09-16T20:10:07Z")

</div>

```
$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -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.
```

---

<div class="post-metadata">

**Author:** ![steven-ayers](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@steven-ayers](https://forums.powershell.org/u/steven-ayers)\
**Post date:** [September 16, 2015, 8:42pm UTC](https://forums.powershell.org/t/am-i-reaching-the-limits-of-powershell-here/4895/3 "2015-09-16T20:42:55Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![steven-ayers](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@steven-ayers](https://forums.powershell.org/u/steven-ayers)\
**Post date:** [September 17, 2015, 6:42pm UTC](https://forums.powershell.org/t/am-i-reaching-the-limits-of-powershell-here/4895/4 "2015-09-17T18:42:15Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![bobmccoy](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/bobmccoy/32/650_2.png) [@bobmccoy](https://forums.powershell.org/u/bobmccoy)\
**Post date:** [September 18, 2015, 3:39am UTC](https://forums.powershell.org/t/am-i-reaching-the-limits-of-powershell-here/4895/5 "2015-09-18T03:39:25Z")

</div>

Glad that worked for you. Have a good weekend.

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:44pm UTC](https://forums.powershell.org/t/am-i-reaching-the-limits-of-powershell-here/4895/6 "2024-05-16T20:44:45Z")

</div>


