{"id":3251,"date":"2022-06-01T03:00:06","date_gmt":"2022-06-01T02:00:06","guid":{"rendered":"https:\/\/www.sebae.net\/blog\/moving-from-the-exchange-powershell-v1-module-to-the-v2-preview\/"},"modified":"2022-06-01T03:00:06","modified_gmt":"2022-06-01T02:00:06","slug":"moving-from-the-exchange-powershell-v1-module-to-the-v2-preview","status":"publish","type":"post","link":"https:\/\/www.sebae.net\/blog\/moving-from-the-exchange-powershell-v1-module-to-the-v2-preview\/","title":{"rendered":"Moving from the Exchange PowerShell v1 Module to the v2 Preview"},"content":{"rendered":"<div>\n<p>Since our recent post explaining the <a href=\"https:\/\/techcommunity.microsoft.com\/t5\/exchange-team-blog\/understanding-the-different-versions-of-exchange-online\/ba-p\/3394487\" target=\"_blank\" rel=\"noopener\">different versions of Exchange Online PowerShell modules<\/a>, we have been asked: <em>What\u2019s the best way to move from using Exchange PowerShell v1 module with Basic auth to using the v2 Preview module with Modern auth?<\/em><\/p>\n<p>First, a bit of news on the subject: with the <a href=\"https:\/\/techcommunity.microsoft.com\/t5\/exchange-team-blog\/exchange-online-powershell-v2-module-preview-now-more-secure\/ba-p\/2922946\" target=\"_blank\" rel=\"noopener\">Exchange Online PowerShell module 2.0.6 Preview 6 version<\/a> module, <em>all<\/em> cmdlets can be run as REST-backed cmdlets. This means that <em>all Exchange Online cmdlets can be used in the Preview 6 module without WinRM Basic auth on the client machine<\/em>.<\/p>\n<p style=\"background: #F0F0F0; padding: .5em; margin: 1em 0 1em 0;\">As a reminder: the Exchange Online PowerShell v1 module with Basic auth will stop working starting October 1, 2022 when Basic authentication is turned off for connections to Exchange Online.<\/p>\n<p>To switch from the v1 module with Basic auth to the v2 preview with Modern auth, you\u2019ll need to install the v2 Preview 6 module by following <a href=\"https:\/\/techcommunity.microsoft.com\/t5\/exchange-team-blog\/exchange-online-powershell-v2-module-preview-now-more-secure\/ba-p\/2922946\" target=\"_blank\" rel=\"noopener\">these instructions<\/a>. Then, configure your connections as described below. If you need help adding Modern auth to your scripts, please see\u00a0<a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/exchange\/app-only-auth-powershell-v2?view=exchange-ps\" target=\"_self\" rel=\"noopener noreferrer\">App-only authentication for unattended scripts in the EXO V2 module<\/a>.<\/p>\n<h1 id=\"toc-hId--2048963909\"><span id=\"scenario-1-connections-to-exchange-online-powershell\">Scenario 1: Connections to Exchange Online PowerShell<\/span><\/h1>\n<p>Your existing PowerShell module connection is similar to the following:<\/p>\n<p>\u00a0<\/p>\n<pre class=\"lia-code-sample language-markdown\"><code>$Session = $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https:\/\/outlook.office365.com\/powershell-liveid\/ -Credential $UserCredential -Authentication Basic -AllowRedirection<\/code><\/pre>\n<p>\u00a0<\/p>\n<p>Using the v2 module (with or without MFA), you can connect using:<\/p>\n<p>\u00a0<\/p>\n<pre class=\"lia-code-sample language-markdown\"><code>Connect-ExchangeOnline -ConnectionUri https:\/\/outlook.office365.com\/powershell-liveid\/ -UserPrincipalName sally@contoso.com<\/code><\/pre>\n<p>\u00a0<\/p>\n<p>You might need to use a different URI depending on your service endpoint:<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"252\">\n<p><strong>Service endpoint<\/strong><\/p>\n<\/td>\n<td width=\"372\">\n<p><strong>URI to use<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"252\">\n<p>Office 365 operated by 21Vianet<\/p>\n<\/td>\n<td width=\"372\">\n<p><a href=\"https:\/\/partner.outlook.cn\/PowerShell\" target=\"_blank\" rel=\"noopener nofollow noreferrer\">https:\/\/partner.outlook.cn\/PowerShell<\/a><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"252\">\n<p>Office 365 Germany<\/p>\n<\/td>\n<td width=\"372\">\n<p><a href=\"https:\/\/outlook.office.de\/powershell-liveid\/\" target=\"_blank\" rel=\"noopener nofollow noreferrer\">https:\/\/outlook.office.de\/powershell-liveid\/<\/a><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"252\">\n<p>Microsoft 365 GCC High<\/p>\n<\/td>\n<td width=\"372\">\n<p><a href=\"https:\/\/outlook.office365.us\/powershell-liveid\/\" target=\"_blank\" rel=\"noopener nofollow noreferrer\">https:\/\/outlook.office365.us\/powershell-liveid\/<\/a><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"252\">\n<p>Microsoft 365 DoD<\/p>\n<\/td>\n<td width=\"372\">\n<p><a href=\"https:\/\/webmail.apps.mil\/powershell-liveid\" target=\"_blank\" rel=\"noopener nofollow noreferrer\">https:\/\/webmail.apps.mil\/powershell-liveid<\/a><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h1 id=\"toc-hId-438548924\"><span id=\"scenario-2-connections-to-security-and-compliance-center-powershell\">Scenario 2: Connections to Security and Compliance Center PowerShell<\/span><\/h1>\n<p>Your existing PowerShell connection is similar to the following:<\/p>\n<p>\u00a0<\/p>\n<pre class=\"lia-code-sample language-markdown\"><code>$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https:\/\/ps.compliance.protection.outlook.com\/powershell-liveid\/ -Credential $UserCredential -Authentication Basic -AllowRedirection<\/code><\/pre>\n<p>\u00a0<\/p>\n<p>Using the Exchange v2 module, you can connect using:<\/p>\n<p>\u00a0<\/p>\n<pre class=\"lia-code-sample language-markdown\"><code>Connect-IPPSSession -Credential (Get-Credential) -ConnectionUri https:\/\/ps.compliance.protection.outlook.com\/powershell-liveid\/<\/code><\/pre>\n<p>\u00a0<\/p>\n<p>You might need to use a different URI depending on your service endpoint:<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"180\">\n<p><strong>Service endpoint<\/strong><\/p>\n<\/td>\n<td width=\"444\">\n<p><strong>URI to use<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"180\">\n<p>Microsoft 365 GCC High<\/p>\n<\/td>\n<td width=\"444\">\n<p><a href=\"https:\/\/ps.compliance.protection.office365.us\/powershell-liveid\/\" target=\"_blank\" rel=\"noopener nofollow noreferrer\">https:\/\/ps.compliance.protection.office365.us\/powershell-liveid\/<\/a><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"180\">\n<p>Microsoft 365 DoD<\/p>\n<\/td>\n<td width=\"444\">\n<p><a href=\"https:\/\/l5.ps.compliance.protection.office365.us\/powershell-liveid\/\" target=\"_blank\" rel=\"noopener nofollow noreferrer\">https:\/\/l5.ps.compliance.protection.office365.us\/powershell-liveid\/<\/a><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h1 id=\"toc-hId--1368905539\"><span id=\"scenario-3-connections-to-exchange-online-protection-powershell\">Scenario 3: Connections to Exchange Online Protection PowerShell<\/span><\/h1>\n<p>Your existing PowerShell connection is similar to the following:<\/p>\n<p>\u00a0<\/p>\n<pre class=\"lia-code-sample language-markdown\"><code>$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https:\/\/ps.protection.outlook.com\/powershell-liveid\/ -Credential $UserCredential -Authentication Basic -AllowRedirection<\/code><\/pre>\n<p>\u00a0<\/p>\n<p>Using the Exchange v2 module, you can connect using:<\/p>\n<p>\u00a0<\/p>\n<pre class=\"lia-code-sample language-markdown\"><code>Connect-IPPSSession -Credential (Get-Credential) -ConnectionUri https:\/\/ps.protection.outlook.com\/powershell-liveid\/<\/code><\/pre>\n<p>\u00a0<\/p>\n<p>You might need to use a different URI depending on your service endpoint:<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"264\">\n<p><strong>Service endpoint<\/strong><\/p>\n<\/td>\n<td width=\"360\">\n<p><strong>URI to use<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"264\">\n<p>Office 365 Germany<\/p>\n<\/td>\n<td width=\"360\">\n<p><a href=\"https:\/\/ps.protection.outlook.de\/powershell-liveid\/\" target=\"_blank\" rel=\"noopener nofollow noreferrer\">https:\/\/ps.protection.outlook.de\/powershell-liveid\/<\/a><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"264\">\n<p>For Exchange Server organizations with Exchange Enterprise CAL with Services licenses<\/p>\n<\/td>\n<td width=\"360\">\n<p><a href=\"https:\/\/outlook.office365.com\/powershell-liveid\/\" target=\"_blank\" rel=\"noopener nofollow noreferrer\">https:\/\/outlook.office365.com\/powershell-liveid\/<\/a><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>We hope you find this useful.\u00a0 Be sure to let us know and share your feedback in the comments section!<\/p>\n<p><span class=\"author\">Exchange Online Manageability Team<\/span><\/p>\n<\/div>\n<p><a href=\"https:\/\/techcommunity.microsoft.com\/t5\/exchange-team-blog\/moving-from-the-exchange-powershell-v1-module-to-the-v2-preview\/ba-p\/3450679\">Read full article (Microsoft Exchange Blog)<\/a><\/p>\n<p>All content and images belong to their respected owners, this article is curated for informational purposes only.<\/p>\n","protected":false},"excerpt":{"rendered":"Since our recent post explaining the different versions of Exchange Online PowerShell modules, we have been asked: What\u2019s&hellip;\n","protected":false},"author":2,"featured_media":2564,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"csco_singular_sidebar":"","csco_page_header_type":"","csco_appearance_grid":"","csco_page_load_nextpost":"","csco_post_video_location":[],"csco_post_video_location_hash":"","csco_post_video_url":"","csco_post_video_bg_start_time":0,"csco_post_video_bg_end_time":0,"footnotes":""},"categories":[15],"tags":[217,671,670],"coauthors":[48],"class_list":["post-3251","post","type-post","status-publish","format-standard","has-post-thumbnail","category-microsoft-exchange-server","tag-post","tag-recent","tag-since","cs-entry","cs-video-wrap"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Moving from the Exchange PowerShell v1 Module to the v2 Preview | Sebae Networks<\/title>\n<meta name=\"description\" content=\"View Moving from the Exchange PowerShell v1 Module to the v2 Preview for free, here at Sebae. Discover more great posts on our website.\" \/>\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.sebae.net\/blog\/moving-from-the-exchange-powershell-v1-module-to-the-v2-preview\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Moving from the Exchange PowerShell v1 Module to the v2 Preview | Sebae Networks\" \/>\n<meta property=\"og:description\" content=\"View Moving from the Exchange PowerShell v1 Module to the v2 Preview for free, here at Sebae. Discover more great posts on our website.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sebae.net\/blog\/moving-from-the-exchange-powershell-v1-module-to-the-v2-preview\/\" \/>\n<meta property=\"og:site_name\" content=\"Sebae Networks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/sebaenetworks\" \/>\n<meta property=\"article:published_time\" content=\"2022-06-01T02:00:06+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.sebae.net\/blog\/wp-content\/uploads\/2023\/12\/sebae-logo-card.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"675\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"James Dean\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@sebaenetworks\" \/>\n<meta name=\"twitter:site\" content=\"@sebaenetworks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"James Dean\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Moving from the Exchange PowerShell v1 Module to the v2 Preview | Sebae Networks","description":"View Moving from the Exchange PowerShell v1 Module to the v2 Preview for free, here at Sebae. Discover more great posts on our website.","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.sebae.net\/blog\/moving-from-the-exchange-powershell-v1-module-to-the-v2-preview\/","og_locale":"en_GB","og_type":"article","og_title":"Moving from the Exchange PowerShell v1 Module to the v2 Preview | Sebae Networks","og_description":"View Moving from the Exchange PowerShell v1 Module to the v2 Preview for free, here at Sebae. Discover more great posts on our website.","og_url":"https:\/\/www.sebae.net\/blog\/moving-from-the-exchange-powershell-v1-module-to-the-v2-preview\/","og_site_name":"Sebae Networks","article_publisher":"https:\/\/www.facebook.com\/sebaenetworks","article_published_time":"2022-06-01T02:00:06+00:00","og_image":[{"width":1200,"height":675,"url":"https:\/\/www.sebae.net\/blog\/wp-content\/uploads\/2023\/12\/sebae-logo-card.jpg","type":"image\/jpeg"}],"author":"James Dean","twitter_card":"summary_large_image","twitter_creator":"@sebaenetworks","twitter_site":"@sebaenetworks","twitter_misc":{"Written by":"James Dean","Estimated reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.sebae.net\/blog\/moving-from-the-exchange-powershell-v1-module-to-the-v2-preview\/#article","isPartOf":{"@id":"https:\/\/www.sebae.net\/blog\/moving-from-the-exchange-powershell-v1-module-to-the-v2-preview\/"},"author":{"name":"James Dean","@id":"https:\/\/www.sebae.net\/blog\/#\/schema\/person\/6d07e05e3d3e4483117c4e2c3315a89f"},"headline":"Moving from the Exchange PowerShell v1 Module to the v2 Preview","datePublished":"2022-06-01T02:00:06+00:00","mainEntityOfPage":{"@id":"https:\/\/www.sebae.net\/blog\/moving-from-the-exchange-powershell-v1-module-to-the-v2-preview\/"},"wordCount":441,"commentCount":0,"publisher":{"@id":"https:\/\/www.sebae.net\/blog\/#organization"},"image":{"@id":"https:\/\/www.sebae.net\/blog\/moving-from-the-exchange-powershell-v1-module-to-the-v2-preview\/#primaryimage"},"thumbnailUrl":"https:\/\/www.sebae.net\/blog\/wp-content\/uploads\/2021\/11\/exchange-server-header.png","keywords":["post","recent","Since"],"articleSection":["Microsoft Exchange Server"],"inLanguage":"en-GB","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.sebae.net\/blog\/moving-from-the-exchange-powershell-v1-module-to-the-v2-preview\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.sebae.net\/blog\/moving-from-the-exchange-powershell-v1-module-to-the-v2-preview\/","url":"https:\/\/www.sebae.net\/blog\/moving-from-the-exchange-powershell-v1-module-to-the-v2-preview\/","name":"Moving from the Exchange PowerShell v1 Module to the v2 Preview | Sebae Networks","isPartOf":{"@id":"https:\/\/www.sebae.net\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.sebae.net\/blog\/moving-from-the-exchange-powershell-v1-module-to-the-v2-preview\/#primaryimage"},"image":{"@id":"https:\/\/www.sebae.net\/blog\/moving-from-the-exchange-powershell-v1-module-to-the-v2-preview\/#primaryimage"},"thumbnailUrl":"https:\/\/www.sebae.net\/blog\/wp-content\/uploads\/2021\/11\/exchange-server-header.png","datePublished":"2022-06-01T02:00:06+00:00","description":"View Moving from the Exchange PowerShell v1 Module to the v2 Preview for free, here at Sebae. Discover more great posts on our website.","breadcrumb":{"@id":"https:\/\/www.sebae.net\/blog\/moving-from-the-exchange-powershell-v1-module-to-the-v2-preview\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sebae.net\/blog\/moving-from-the-exchange-powershell-v1-module-to-the-v2-preview\/"]}]},{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.sebae.net\/blog\/moving-from-the-exchange-powershell-v1-module-to-the-v2-preview\/#primaryimage","url":"https:\/\/www.sebae.net\/blog\/wp-content\/uploads\/2021\/11\/exchange-server-header.png","contentUrl":"https:\/\/www.sebae.net\/blog\/wp-content\/uploads\/2021\/11\/exchange-server-header.png","width":1920,"height":1080,"caption":"exchange server header"},{"@type":"BreadcrumbList","@id":"https:\/\/www.sebae.net\/blog\/moving-from-the-exchange-powershell-v1-module-to-the-v2-preview\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sebae.net\/blog\/"},{"@type":"ListItem","position":2,"name":"Moving from the Exchange PowerShell v1 Module to the v2 Preview"}]},{"@type":"WebSite","@id":"https:\/\/www.sebae.net\/blog\/#website","url":"https:\/\/www.sebae.net\/blog\/","name":"Sebae Networks","description":"Tech Tips, News, Tutorials &amp; Advice","publisher":{"@id":"https:\/\/www.sebae.net\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sebae.net\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":"Organization","@id":"https:\/\/www.sebae.net\/blog\/#organization","name":"Sebae","url":"https:\/\/www.sebae.net\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.sebae.net\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.sebae.net\/blog\/wp-content\/uploads\/2023\/06\/sebae-logo-icon.png","contentUrl":"https:\/\/www.sebae.net\/blog\/wp-content\/uploads\/2023\/06\/sebae-logo-icon.png","width":512,"height":512,"caption":"Sebae"},"image":{"@id":"https:\/\/www.sebae.net\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/sebaenetworks","https:\/\/x.com\/sebaenetworks"]},{"@type":"Person","@id":"https:\/\/www.sebae.net\/blog\/#\/schema\/person\/6d07e05e3d3e4483117c4e2c3315a89f","name":"James Dean","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.sebae.net\/blog\/wp-content\/uploads\/2021\/10\/avatar_user_2_1634496168-96x96.jpg72371c27260698ee55141397050ef40a","url":"https:\/\/www.sebae.net\/blog\/wp-content\/uploads\/2021\/10\/avatar_user_2_1634496168-96x96.jpg","contentUrl":"https:\/\/www.sebae.net\/blog\/wp-content\/uploads\/2021\/10\/avatar_user_2_1634496168-96x96.jpg","caption":"James Dean"},"sameAs":["https:\/\/www.sebae.net"],"url":"https:\/\/www.sebae.net\/blog\/author\/jdean\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.sebae.net\/blog\/wp-json\/wp\/v2\/posts\/3251","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sebae.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sebae.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sebae.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sebae.net\/blog\/wp-json\/wp\/v2\/comments?post=3251"}],"version-history":[{"count":0,"href":"https:\/\/www.sebae.net\/blog\/wp-json\/wp\/v2\/posts\/3251\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sebae.net\/blog\/wp-json\/wp\/v2\/media\/2564"}],"wp:attachment":[{"href":"https:\/\/www.sebae.net\/blog\/wp-json\/wp\/v2\/media?parent=3251"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sebae.net\/blog\/wp-json\/wp\/v2\/categories?post=3251"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sebae.net\/blog\/wp-json\/wp\/v2\/tags?post=3251"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.sebae.net\/blog\/wp-json\/wp\/v2\/coauthors?post=3251"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}