{"id":299,"date":"2011-07-19T23:00:02","date_gmt":"2011-07-19T22:00:02","guid":{"rendered":"http:\/\/emtunc.org\/blog\/?p=299"},"modified":"2013-06-15T13:13:12","modified_gmt":"2013-06-15T12:13:12","slug":"close-your-powershell-sessions-office-365","status":"publish","type":"post","link":"https:\/\/emtunc.org\/blog\/07\/2011\/close-your-powershell-sessions-office-365\/","title":{"rendered":"Close Your PowerShell Sessions! &#8211; Office 365"},"content":{"rendered":"<p>If you have ever received the error message below or a similar one then you are not closing your PowerShell sessions properly (or at all!).<\/p>\n<p><span style=\"color: #ff0000;\">[serverName] Connecting to remote server failed with the following error message : The WS-Management service cannot process the request. This user is allowed a maximum number of 3 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.<\/span><br \/>\n<span style=\"color: #ff0000;\">+ CategoryInfo\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 : OpenError: (System.Manageme&#8230;.RemoteRunspace:RemoteRunspace) [], PSRemotingTransportException + FullyQualifiedErrorId : PSSessionOpenFailed<\/span><\/p>\n<p><!--more--><\/p>\n<p><span style=\"color: #000000;\">The way to close your PowerShell sessions is to use the <strong>Remove-PSSession<\/strong><\/span> command once you have finished with your session.<br \/>\nExample:<\/p>\n<p>We use the following to create the session:<\/p>\n<p><code>$Session = New-PSSession -ConfigurationName Microsoft.Exchange-ConnectionUri https:\/\/ps.outlook.com\/powershell\/ -Credential $LiveCred -Authentication Basic -AllowRedirection<\/code><\/p>\n<p>We now end the above session by entering:<\/p>\n<p><code>Remove-PSSession $Session<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you have ever received the error message below or a similar one then you are not closing your PowerShell sessions properly (or at all!). [serverName] Connecting to remote server failed with the following error message : The WS-Management service cannot process the request. This user is allowed a maximum number of 3 concurrent shells, [&hellip;]<\/p>\n","protected":false},"author":32,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"footnotes":""},"categories":[1],"tags":[37,42],"class_list":["post-299","post","type-post","status-publish","format-standard","hentry","category-tech","tag-office-365","tag-powershell"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1trTO-4P","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/emtunc.org\/blog\/wp-json\/wp\/v2\/posts\/299","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/emtunc.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/emtunc.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/emtunc.org\/blog\/wp-json\/wp\/v2\/users\/32"}],"replies":[{"embeddable":true,"href":"https:\/\/emtunc.org\/blog\/wp-json\/wp\/v2\/comments?post=299"}],"version-history":[{"count":2,"href":"https:\/\/emtunc.org\/blog\/wp-json\/wp\/v2\/posts\/299\/revisions"}],"predecessor-version":[{"id":917,"href":"https:\/\/emtunc.org\/blog\/wp-json\/wp\/v2\/posts\/299\/revisions\/917"}],"wp:attachment":[{"href":"https:\/\/emtunc.org\/blog\/wp-json\/wp\/v2\/media?parent=299"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/emtunc.org\/blog\/wp-json\/wp\/v2\/categories?post=299"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/emtunc.org\/blog\/wp-json\/wp\/v2\/tags?post=299"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}