How can I connect ExchangeOnline and IPPSSession at the same time

Aase Nomad 246 Reputation points
2022-05-22T18:58:01.743+00:00

I'm trying to connect both ExcahangeOnline and IPPSession so that I can use both in my script but some reason it remove the other from connection after one got connected. Any idea?

Connect-IPPSSession -Credential $credential -ErrorAction Stop | Out-Null
    Connect-ExchangeOnline -Credential $credential
Exchange | Exchange Server | Management
Exchange | Exchange Server | Management
The administration and maintenance of Microsoft Exchange Server to ensure secure, reliable, and efficient email and collaboration services across an organization.
Windows for business | Windows Server | User experience | PowerShell
Microsoft Security | Microsoft Graph
{count} votes

Answer accepted by question author
  1. KyleXu-MSFT 26,396 Reputation points
    2022-05-23T01:59:17.007+00:00

    @Aase Nomad

    Here are limitations about Exchange online and Security & Compliance PowerShell sessions:
    204424-qa-kyle-09-53-47.png
    204437-qa-kyle-09-53-26.png

    Have you tried to connect them from PowerShell rather than script directly?

    I connect to the Exchange online first, then connect to the Security & Compliance. Both sessions exist:

    204457-qa-kyle-09-36-37.png

    I could run both Exchange online and Security & Compliance commands:
    204369-qa-kyle-09-39-30.png

    The "Get-Mailbox" command contained in Exchange online rather than Security & Compliance.

    The "Get-ComplianceSearchAction" command contained in the Security & Compliance rather than Exchange online.

    I tried to connect Security & Compliance first, then Exchange online. It also works.

    You can also try to connect to them with different accounts, such as using admin A to connect to Exchange online, then using admin B to connect to "Security & Compliance". If you still cannot connect from PowerShell in this way. I would suggest you confirm with Windows Server side, check whether there exists any configuration to limit your client only create one session.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.