{"id":336,"date":"2020-04-16T16:45:06","date_gmt":"2020-04-16T23:45:06","guid":{"rendered":"https:\/\/www.vscrypt.com\/?p=336"},"modified":"2020-08-21T13:07:45","modified_gmt":"2020-08-21T20:07:45","slug":"connect-to-exchange-servers-using-remote-powershell","status":"publish","type":"post","link":"https:\/\/www.vscrypt.com\/connect-to-exchange-servers-using-remote-powershell\/","title":{"rendered":"Connect to Exchange servers using remote PowerShell"},"content":{"rendered":"\n<p>If you don\u2019t have Exchange management tools installed on your computer, you can use Windows PowerShell to create a remote session to an Exchange server.&nbsp; Open Windows PowerShell on your computer and run the following commands:<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"has-normal-font-size wp-block-heading\"><strong>To Connect<\/strong><\/h2>\n\n\n\n<p>The first step is to specify the credentials you will be using to connect because, in an ideal environment, your local account will not have access to an Exchange Server.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"PowerShell\" data-shcb-language-slug=\"powershell\"><span><code class=\"hljs language-powershell\"><span class=\"hljs-variable\">$UserCredential<\/span> = <span class=\"hljs-built_in\">Get-Credential<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PowerShell<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">powershell<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Next, we need to create a PowerShell session to the Exchange server.&nbsp; You will need to specify the Exchange server FQDN (Fully Qualified Domain Name).&nbsp; e.g. ExchangeServer.domain.com<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"PowerShell\" data-shcb-language-slug=\"powershell\"><span><code class=\"hljs language-powershell shcb-wrap-lines\"><span class=\"hljs-variable\">$Session<\/span> = <span class=\"hljs-built_in\">New-PSSession<\/span> <span class=\"hljs-literal\">-ConfigurationName<\/span> Microsoft.Exchange <span class=\"hljs-literal\">-ConnectionUri<\/span> http:\/\/&lt;ServerFQDN&gt;\/PowerShell\/ <span class=\"hljs-literal\">-Authentication<\/span> Kerberos <span class=\"hljs-literal\">-Credential<\/span> <span class=\"hljs-variable\">$UserCredential<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PowerShell<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">powershell<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Then we import the session to establish the connection.<\/p><div id=\"vscry-1\" class=\"vscry-content\"><script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-0201055796701118\" crossorigin=\"anonymous\"><\/script><ins class=\"adsbygoogle\" style=\"display:block; text-align:center;\" data-ad-client=\"ca-pub-0201055796701118\" \ndata-ad-slot=\"1379369629\" \ndata-ad-layout=\"in-article\"\ndata-ad-format=\"fluid\"><\/ins>\n<script> \n(adsbygoogle = window.adsbygoogle || []).push({}); \n<\/script>\n<\/div>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"PowerShell\" data-shcb-language-slug=\"powershell\"><span><code class=\"hljs language-powershell\"><span class=\"hljs-built_in\">Import-PSSession<\/span> <span class=\"hljs-variable\">$Session<\/span> <span class=\"hljs-literal\">-DisableNameChecking<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PowerShell<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">powershell<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>After you run the above command, you can check to make sure everything worked as expected by running a simple&nbsp;<strong>Get-Mailbox<\/strong>&nbsp;command to see if you get any results.<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"has-normal-font-size wp-block-heading\"><strong>To Disconnect<\/strong><\/h2>\n\n\n\n<p>To disconnect the session just execute the following.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"PowerShell\" data-shcb-language-slug=\"powershell\"><span><code class=\"hljs language-powershell\"><span class=\"hljs-built_in\">Remove-PSSession<\/span> <span class=\"hljs-variable\">$Session<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PowerShell<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">powershell<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>If you don&#8217;t have Exchange management tools installed your computer, you can use Windows PowerShell to create a remote session to an Exchange server.<\/p>\n","protected":false},"author":1,"featured_media":344,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,4],"tags":[85,9,34],"class_list":["post-336","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ps","category-scripts","tag-exchange-server","tag-powershell","tag-remote-powershell"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Connect to Exchange servers using remote PowerShell - VScrypt<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.vscrypt.com\/connect-to-exchange-servers-using-remote-powershell\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Connect to Exchange servers using remote PowerShell - VScrypt\" \/>\n<meta property=\"og:description\" content=\"If you don&#039;t have Exchange management tools installed your computer, you can use Windows PowerShell to create a remote session to an Exchange server.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.vscrypt.com\/connect-to-exchange-servers-using-remote-powershell\/\" \/>\n<meta property=\"og:site_name\" content=\"VScrypt\" \/>\n<meta property=\"article:published_time\" content=\"2020-04-16T23:45:06+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-08-21T20:07:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.vscrypt.com\/wp-content\/uploads\/2020\/04\/PowerShell.png\" \/>\n\t<meta property=\"og:image:width\" content=\"449\" \/>\n\t<meta property=\"og:image:height\" content=\"448\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Vikram\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Vikram\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.vscrypt.com\/connect-to-exchange-servers-using-remote-powershell\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.vscrypt.com\/connect-to-exchange-servers-using-remote-powershell\/\"},\"author\":{\"name\":\"Vikram\",\"@id\":\"https:\/\/www.vscrypt.com\/#\/schema\/person\/855a3e6d9310019d20f2da32115df36a\"},\"headline\":\"Connect to Exchange servers using remote PowerShell\",\"datePublished\":\"2020-04-16T23:45:06+00:00\",\"dateModified\":\"2020-08-21T20:07:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.vscrypt.com\/connect-to-exchange-servers-using-remote-powershell\/\"},\"wordCount\":159,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.vscrypt.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.vscrypt.com\/connect-to-exchange-servers-using-remote-powershell\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.vscrypt.com\/wp-content\/uploads\/2020\/04\/PowerShell.png\",\"keywords\":[\"exchange server\",\"powershell\",\"remote powershell\"],\"articleSection\":[\"PowerShell\",\"Scripts\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.vscrypt.com\/connect-to-exchange-servers-using-remote-powershell\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.vscrypt.com\/connect-to-exchange-servers-using-remote-powershell\/\",\"url\":\"https:\/\/www.vscrypt.com\/connect-to-exchange-servers-using-remote-powershell\/\",\"name\":\"Connect to Exchange servers using remote PowerShell - VScrypt\",\"isPartOf\":{\"@id\":\"https:\/\/www.vscrypt.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.vscrypt.com\/connect-to-exchange-servers-using-remote-powershell\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.vscrypt.com\/connect-to-exchange-servers-using-remote-powershell\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.vscrypt.com\/wp-content\/uploads\/2020\/04\/PowerShell.png\",\"datePublished\":\"2020-04-16T23:45:06+00:00\",\"dateModified\":\"2020-08-21T20:07:45+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.vscrypt.com\/connect-to-exchange-servers-using-remote-powershell\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.vscrypt.com\/connect-to-exchange-servers-using-remote-powershell\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.vscrypt.com\/connect-to-exchange-servers-using-remote-powershell\/#primaryimage\",\"url\":\"https:\/\/www.vscrypt.com\/wp-content\/uploads\/2020\/04\/PowerShell.png\",\"contentUrl\":\"https:\/\/www.vscrypt.com\/wp-content\/uploads\/2020\/04\/PowerShell.png\",\"width\":449,\"height\":448},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.vscrypt.com\/connect-to-exchange-servers-using-remote-powershell\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.vscrypt.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Connect to Exchange servers using remote PowerShell\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.vscrypt.com\/#website\",\"url\":\"https:\/\/www.vscrypt.com\/\",\"name\":\"VScrypt\",\"description\":\"Helpful scripts, snippets and guides...\",\"publisher\":{\"@id\":\"https:\/\/www.vscrypt.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.vscrypt.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.vscrypt.com\/#organization\",\"name\":\"VScrypt\",\"url\":\"https:\/\/www.vscrypt.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.vscrypt.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.vscrypt.com\/wp-content\/uploads\/2019\/01\/logo-1.png\",\"contentUrl\":\"https:\/\/www.vscrypt.com\/wp-content\/uploads\/2019\/01\/logo-1.png\",\"width\":200,\"height\":80,\"caption\":\"VScrypt\"},\"image\":{\"@id\":\"https:\/\/www.vscrypt.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.vscrypt.com\/#\/schema\/person\/855a3e6d9310019d20f2da32115df36a\",\"name\":\"Vikram\",\"description\":\"I am just an IT person trying to share as much knowledge as possible hoping someone will find it helpful. It just takes time to organize everything from my head into something that makes sense.\",\"url\":\"https:\/\/www.vscrypt.com\/author\/vchand\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Connect to Exchange servers using remote PowerShell - VScrypt","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.vscrypt.com\/connect-to-exchange-servers-using-remote-powershell\/","og_locale":"en_US","og_type":"article","og_title":"Connect to Exchange servers using remote PowerShell - VScrypt","og_description":"If you don't have Exchange management tools installed your computer, you can use Windows PowerShell to create a remote session to an Exchange server.","og_url":"https:\/\/www.vscrypt.com\/connect-to-exchange-servers-using-remote-powershell\/","og_site_name":"VScrypt","article_published_time":"2020-04-16T23:45:06+00:00","article_modified_time":"2020-08-21T20:07:45+00:00","og_image":[{"width":449,"height":448,"url":"https:\/\/www.vscrypt.com\/wp-content\/uploads\/2020\/04\/PowerShell.png","type":"image\/png"}],"author":"Vikram","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Vikram","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.vscrypt.com\/connect-to-exchange-servers-using-remote-powershell\/#article","isPartOf":{"@id":"https:\/\/www.vscrypt.com\/connect-to-exchange-servers-using-remote-powershell\/"},"author":{"name":"Vikram","@id":"https:\/\/www.vscrypt.com\/#\/schema\/person\/855a3e6d9310019d20f2da32115df36a"},"headline":"Connect to Exchange servers using remote PowerShell","datePublished":"2020-04-16T23:45:06+00:00","dateModified":"2020-08-21T20:07:45+00:00","mainEntityOfPage":{"@id":"https:\/\/www.vscrypt.com\/connect-to-exchange-servers-using-remote-powershell\/"},"wordCount":159,"commentCount":0,"publisher":{"@id":"https:\/\/www.vscrypt.com\/#organization"},"image":{"@id":"https:\/\/www.vscrypt.com\/connect-to-exchange-servers-using-remote-powershell\/#primaryimage"},"thumbnailUrl":"https:\/\/www.vscrypt.com\/wp-content\/uploads\/2020\/04\/PowerShell.png","keywords":["exchange server","powershell","remote powershell"],"articleSection":["PowerShell","Scripts"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.vscrypt.com\/connect-to-exchange-servers-using-remote-powershell\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.vscrypt.com\/connect-to-exchange-servers-using-remote-powershell\/","url":"https:\/\/www.vscrypt.com\/connect-to-exchange-servers-using-remote-powershell\/","name":"Connect to Exchange servers using remote PowerShell - VScrypt","isPartOf":{"@id":"https:\/\/www.vscrypt.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.vscrypt.com\/connect-to-exchange-servers-using-remote-powershell\/#primaryimage"},"image":{"@id":"https:\/\/www.vscrypt.com\/connect-to-exchange-servers-using-remote-powershell\/#primaryimage"},"thumbnailUrl":"https:\/\/www.vscrypt.com\/wp-content\/uploads\/2020\/04\/PowerShell.png","datePublished":"2020-04-16T23:45:06+00:00","dateModified":"2020-08-21T20:07:45+00:00","breadcrumb":{"@id":"https:\/\/www.vscrypt.com\/connect-to-exchange-servers-using-remote-powershell\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.vscrypt.com\/connect-to-exchange-servers-using-remote-powershell\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.vscrypt.com\/connect-to-exchange-servers-using-remote-powershell\/#primaryimage","url":"https:\/\/www.vscrypt.com\/wp-content\/uploads\/2020\/04\/PowerShell.png","contentUrl":"https:\/\/www.vscrypt.com\/wp-content\/uploads\/2020\/04\/PowerShell.png","width":449,"height":448},{"@type":"BreadcrumbList","@id":"https:\/\/www.vscrypt.com\/connect-to-exchange-servers-using-remote-powershell\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.vscrypt.com\/"},{"@type":"ListItem","position":2,"name":"Connect to Exchange servers using remote PowerShell"}]},{"@type":"WebSite","@id":"https:\/\/www.vscrypt.com\/#website","url":"https:\/\/www.vscrypt.com\/","name":"VScrypt","description":"Helpful scripts, snippets and guides...","publisher":{"@id":"https:\/\/www.vscrypt.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.vscrypt.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.vscrypt.com\/#organization","name":"VScrypt","url":"https:\/\/www.vscrypt.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.vscrypt.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.vscrypt.com\/wp-content\/uploads\/2019\/01\/logo-1.png","contentUrl":"https:\/\/www.vscrypt.com\/wp-content\/uploads\/2019\/01\/logo-1.png","width":200,"height":80,"caption":"VScrypt"},"image":{"@id":"https:\/\/www.vscrypt.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.vscrypt.com\/#\/schema\/person\/855a3e6d9310019d20f2da32115df36a","name":"Vikram","description":"I am just an IT person trying to share as much knowledge as possible hoping someone will find it helpful. It just takes time to organize everything from my head into something that makes sense.","url":"https:\/\/www.vscrypt.com\/author\/vchand\/"}]}},"_links":{"self":[{"href":"https:\/\/www.vscrypt.com\/api\/wp\/v2\/posts\/336","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vscrypt.com\/api\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vscrypt.com\/api\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vscrypt.com\/api\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vscrypt.com\/api\/wp\/v2\/comments?post=336"}],"version-history":[{"count":0,"href":"https:\/\/www.vscrypt.com\/api\/wp\/v2\/posts\/336\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.vscrypt.com\/api\/wp\/v2\/media\/344"}],"wp:attachment":[{"href":"https:\/\/www.vscrypt.com\/api\/wp\/v2\/media?parent=336"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vscrypt.com\/api\/wp\/v2\/categories?post=336"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vscrypt.com\/api\/wp\/v2\/tags?post=336"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}