Forum

Posts by OTimme (OTimme)

OTimme
OTimme
Posts: 3

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 ...

7 yrs Connecting to Office 365 Powershell
OTimme
OTimme
Posts: 3

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

7 yrs Connecting to Office 365 Powershell
OTimme
OTimme
Posts: 3

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

7 yrs Connecting to Office 365 Powershell