Choose from list of server names

Welcome Forums General PowerShell Q&A Choose from list of server names

Viewing 2 reply threads
  • Author
    Posts
    • #202178
      Participant
      Topics: 1
      Replies: 0
      Points: 11
      Rank: Member

      Hello,

      I want my PowerShell script to choose dynamically from a list of servers to send a request. I want PowerShell to decide where the request goes to, rather than a user prompt.

      Any ideas on how this can be achieved? I’ve not been successful on my google searching so far!

      Thanks,

    • #202187
      Participant
      Topics: 11
      Replies: 30
      Points: 215
      Helping Hand
      Rank: Participant

      Put your servers into a list called $Servers, then do $Servers | Get-Random, and you’ll get a random server from the list to send the request.

    • #202199
      Participant
      Topics: 12
      Replies: 1642
      Points: 2,660
      Helping Hand
      Rank: Community Hero

      I want my PowerShell script to choose dynamically from a list of servers to send a request. I want PowerShell to decide where the request goes to, rather than a user prompt.

      Choose dynamically based on what? Logic? A random list? Zodiac sign of the user? Provide specifics and code that you have tried, current result, expected result, etc.

Viewing 2 reply threads
  • The topic ‘Choose from list of server names’ is closed to new replies.