title: The WS-Management service cannot process the request :Powershell
body: <p>I randomly get below error</p>
  
  <blockquote>
    <p>The WS-Management service 
    cannot process the request. This user is allowed a maximum number of 5 concurrent shells, which has been exceeded. Close existing 
    shells or raise the quota for this user. For more information, see the about_Remote_Troubleshooting Help topic.</p>
  </blockquote>
  
  <p>my sample code does below</p>
  
  <pre><code>try
  {
      $serverlist=server1...server100
      foreach($computer in $computers)
      {
      Enter-PSSession -ComputerName $computer
  
      $Ostype = (Get-WmiObject  -Class Win32_OperatingSystem  -ComputerName $computer -ErrorAction SilentlyContinue ).Caption 
  
      Exit-PSSession
  }
      }
      Catch
      {
      [System.Windows.MessageBox]::Show($_.exception.message)
      }
      finally
      {
      Exit-pssession
      }
  </code></pre>
  
  <p>Some times errors occur during my execution of script,so the above error is leading me to believe,i am not closing my PSsession properly.</p>
  
  <p>Can some one please let me know if i am doing right</p>