How to create multiple PSSession to exchange management shell

Welcome Forums General PowerShell Q&A How to create multiple PSSession to exchange management shell

  • This topic has 6 replies, 4 voices, and was last updated 4 weeks ago by
    Participant
    .
Viewing 5 reply threads
  • Author
    Posts
    • #281785
      Participant
      Topics: 11
      Replies: 11
      Points: 130
      Rank: Participant

      Hi
      I am trying to create multiple PSSession to exchange management shell. I can’t figure out how to get this done. The code below is

       

    • #281825
      Participant
      Topics: 1
      Replies: 59
      Points: 584
      Helping Hand
      Rank: Major Contributor

      Hello,

      Can you please elaborate? What the goal?

      Are you connecting to all servers using same credentials?

       

      Thank you.

    • #281828
      Participant
      Topics: 5
      Replies: 349
      Points: 632
      Helping Hand
      Rank: Major Contributor
    • #281834
      Participant
      Topics: 1
      Replies: 59
      Points: 584
      Helping Hand
      Rank: Major Contributor

      Try to use Invoke-Command with Session parameter.

      You can try something similar to this:

      Or this:

      Hope that helps.

    • #281849
      Participant
      Topics: 11
      Replies: 11
      Points: 130
      Rank: Participant

      Oh, thanks. It’s functioning.
      I tried to add the line below and received error.

      Error: the term format table is not recognized as the name of a cmdlet

       

    • #281957
      Participant
      Topics: 9
      Replies: 706
      Points: 2,837
      Helping Hand
      Rank: Community Hero

      You should Format-Table outside of the Invoke-Command as it’s a formatting command. The data needs to be serialized and sent over and I’m fairly certain that breaks with the Format-* commands.

      • #281969
        Participant
        Topics: 11
        Replies: 11
        Points: 130
        Rank: Participant

        Thanks. It is working now. 🙂

Viewing 5 reply threads
  • You must be logged in to reply to this topic.