Users

All Posts (3)

avatar

OTimme

Connecting to Office 365 Powershell

avatar
avatar
avatar
avatar
avatar

I found the Problem, the special characters I normaly use in passwords! The used password is like C!ty$t0re and it seems that the special characters needs to be escaped or otherwise marked ...

Connecting to Office 365 Powershell

avatar
avatar
avatar
avatar
avatar

did not work here ... I still got the same error. It seems the submisson of the credentials to O365 fails.

Connecting to Office 365 Powershell

avatar
avatar
avatar
avatar
avatar

Hello

I would like to connect to various Office 365 powershells directly from RemoteDesktopManager. My problem is the credential delivery. Normally I get the credentials with:

$LiveCred = GetCredential

Then a credential window pops up and I have to enter the crendetials of the Office 365 account I wish to connect with.

But I want to enter the credentials in the connection setting in RDM and call them together with the script. I have searched for other possibilities and found a way to setup the PSCredential manually from command line options, wich I can feed with RDM:

$User = $args[0]

$Pass = ConvertTo-SecureString -String "$args[1]" -AsPlainText -Force

$LiveCred = New-Object –TypeName System.Management.Automation.PSCredential –ArgumentList $User, $Pass

But I get allways an error connecting to the Office 365 remote powershell (no access). Any ideas?

The complete script I call from RDM looks like this:

---$User = $args[0]

$Pass = ConvertTo-SecureString -String "$args[1]" -AsPlainText -Force

$LiveCred = New-Object –TypeName System.Management.Automation.PSCredential –ArgumentList $User, $Pass

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection

Import-PSSession $Session

Import-Module MSOnline

Connect-MsolService -Credential $LiveCred

---

Oliver

edited by OTimme on 6/12/2013

1 - 3 of 3 items