Hi,
what I want to do is create some service that will create and maintain PSSession to Exchange online server (Office365). So I dont have to always create new session when I have to run some command on that servers and remove session after finish (throttling limits). Instead, I will send some PS commands to that service. Exchange online servers arent using PS 3.0 (disconnect-pssession is not available).
Sessions to Exchange online are created like this:
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $Cred -Authentication Basic -AllowRedirection
Import-PSSession $Session -commandname get-mailbox
So this will be the service part. And when I need to get some mailbox information, I will send command get-mailbox xxx@domain.com to that service (somewhat?) and get result.
I am trying to figure this out for few days now, but I really dont know how to achieve this.
Thank you.