Users

All Posts (9)

avatar

logiqit

Connecting to Office 365 Powershell

avatar
avatar
avatar
avatar
avatar

It Works, do not ask what has changed, but I was just playing around with the desktop shortcut functionality in RDM and tried it once more for that connection, and it worked!

Thank you for your assistance and a fantastic product!

Connecting to Office 365 Powershell

avatar
avatar
avatar
avatar
avatar

Hi Stefane,

Thank you for your response.

I have tried your suggested setup, except for the 64-bit, and it makes no change. I have also tried to run it from a colleagues machine, and his machine has the same issue.

The reason I cannot run the 32-bit is that I have the 64-bit Microsoft Online Services Module for Windows PowerShell installed. If need to run 32-bit I will have to uninstall the 64-bit and install the 32-bit, since they cannot be installed in co-existance.

Can you replicate the issue on your setup?

Thank you.

Connecting to Office 365 Powershell

avatar
avatar
avatar
avatar
avatar

...but I cannot execute any commands at all related to the session I log in to in the script.

It looks like the session stops with the execution of the script.

Is there some command that will let the session stay open and wait for more commands inside the script?

This is how my script looks now:

Set-ExecutionPolicy RemoteSigned

$User = $args[0]

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

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

$LiveCred = Get-Credential -Credential $PSCred

$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

Connecting to Office 365 Powershell

avatar
avatar
avatar
avatar
avatar

It works when included in the script

Connecting to Office 365 Powershell

avatar
avatar
avatar
avatar
avatar

It is a PowerShell session where I pass on credentials as arguments, just like you wrote earlier in this thread.

This is how it is set up

...and when I run it, it logs on to Office 365, and ends with the following prompt:

Running a command from there just results in an error, since I am no longer in the session:

Thank you

Connecting to Office 365 Powershell

avatar
avatar
avatar
avatar
avatar

Hi there,

I got it working, but is there something I can add to the script to make is stay in the session, and thereby let me enter commands?

In my environment it connects, and then I get the PowerShell prompt...that is, I am not in the session anymore.

Thank you!

Feature request

avatar
avatar
avatar

Superb, I cannot wait :)

Feature request

avatar
avatar
avatar

Hi David,

I see that now, thank you!

I have one more idea for you:

We use WinSCP for handling and edition linux files, I am sure many others are as well. It can do SCP, SFTP and FTP connections to servers, and is easily controlled va command line.

Example with SCP: WinSCP.exe scp://<username>:<password>@<hostname or IP>

Example with SFTP: WinSCP.exe sftp://<username>:<password>@<hostname or IP>

Example with SCP: WinSCP.exe ftp://<username>:<password>@<hostname or IP>

Usernames, passwords and hostnames/IPs without the <>

/Ulrich

edited by logiqit on 4/16/2009

Feature request

avatar
avatar
avatar

As a former user of Code4wards Royal TS, I miss the option to right-click a connection, and choose between "Connect", "Connect to Console" and "Connect withough autologon"

These options makes administrating Windows servers much easier, since we often need to logon as a different user, and also to the console.

Very nice product, and happy user of the Enterprise edition.

Thx Ulrich,

LogiqIT

1 - 9 of 9 items