{"id":1772,"date":"2017-02-16T07:30:56","date_gmt":"2017-02-15T20:30:56","guid":{"rendered":"https:\/\/itgroove.net\/mmman\/?p=1772"},"modified":"2023-02-24T21:39:32","modified_gmt":"2023-02-24T21:39:32","slug":"how-to-change-the-domain-of-multiple-sharepoint-accounts","status":"publish","type":"post","link":"https:\/\/regroove.ca\/archive\/2017\/02\/16\/how-to-change-the-domain-of-multiple-sharepoint-accounts\/","title":{"rendered":"How to Change the Domain of Multiple SharePoint Accounts"},"content":{"rendered":"<p>Very recently I had to change a bunch of accounts from one domain to another in SharePoint.  Rather than doing this piecemeal for each individual account, I decided to write a simple script to do this for me.  Since I couldn&#8217;t find this online, I figured I&#8217;d demonstrate how I did it.\n<\/p>\n<p>\u00a0<br \/>\n\u00a0<\/p>\n<p>Start by creating a 2 column Comma Separated Value (CSV) file.  This is just a plain text file where the left side is the original domain of the user, and the right side is the *new* domain for that same user.  In my case we were using SP2010 and moving the users from classic to claims, so I added a claims token in at the same time.\n<\/p>\n<p>\u00a0<br \/>\n\u00a0<\/p>\n<h2><span style=\"color:#2e75b5;font-size:14pt\">The CSV File<br \/>\n<\/span><\/h2>\n<p>(Original domain user on left, updated domain user on right.  I saved this file under c:\\top\\out.csv)\n<\/p>\n<p>\u00a0<br \/>\n\u00a0<\/p>\n<p>ABC-NA\\enwqc,i:0#.w|COMPANY\\enwqc\n<\/p>\n<p>ABC-NA\\eotib,i:0#.w|COMPANY\\eotib\n<\/p>\n<p>ABC-NA\\ergyp,i:0#.w|COMPANY\\ergyp\n<\/p>\n<p>\u2026\n<\/p>\n<p>\u00a0<br \/>\n\u00a0<\/p>\n<p>Next, I needed some PowerShell that would read the CSV file, and process each user (move them from the old domain to the new domain)\n<\/p>\n<p>\u00a0<br \/>\n\u00a0<\/p>\n<h2><span style=\"color:#2e75b5;font-size:14pt\">The PowerShell Code<br \/>\n<\/span><\/h2>\n<p>(Note: You need to specify the SharePoint site (Web) that you want to apply this change to &#8211; yes, you have to do this site by site.  Update the URL in the code below before proceeding)\n<\/p>\n<p>\u00a0<br \/>\n\u00a0<\/p>\n<p>$path = &#8220;c:\\top\\out.csv&#8221;\n<\/p>\n<p>Import-Csv $path -Header Name,Value | Foreach-Object{\n<\/p>\n<p style=\"margin-left: 27pt\">$old = $_.Name\n<\/p>\n<p style=\"margin-left: 27pt\">$new = $_.Value\n<\/p>\n<p style=\"margin-left: 27pt\">write-host &#8220;about to update user $old to $new.&#8221;\n<\/p>\n<p style=\"margin-left: 27pt\">$user = get-SPUser -Identity &#8220;$old&#8221; -Web <a href=\"https:\/\/[DOMAIN]\/sites\/%5bSITE%5d\">https:\/\/[DOMAIN]\/sites\/[SITE]<\/a>\n\t<\/p>\n<p style=\"margin-left: 27pt\">Move-SPUser -Identity $user -IgnoreSID -NewAlias &#8220;$new&#8221; -Confirm:$false\n<\/p>\n<p>}\n<\/p>\n<p>\u00a0<br \/>\n\u00a0<\/p>\n<p>To run this script, simply copy the lines above and paste it into a SharePoint Administrator PowerShell.  The output will look similar to what you see below.\n<\/p>\n<p>\u00a0<br \/>\n\u00a0<\/p>\n<h2><span style=\"color:#2e75b5;font-size:14pt\">The Script Running\u2026<br \/>\n<\/span><\/h2>\n<p>\u00a0<br \/>\n\u00a0<\/p>\n<p>about to update user ABC-NA\\ggdxb to i:0#.w|COMPANY\\ggdxb.\n<\/p>\n<p>about to update user ABC-NA\\gcmuy to i:0#.w|COMPANY\\gcmuy.\n<\/p>\n<p>about to update user ABC-NA\\evlgx to i:0#.w|COMPANY\\evlgx.\n<\/p>\n<p>\u2026\n<\/p>\n<p>\u00a0<br \/>\n\u00a0<\/p>\n<p>There&#8217;s obviously an improvement that could be made to this script in that it could also be written to iterate over a collection of sites (webs), but I didn&#8217;t have a need to do that.  To do this, you would simply wrap the code above in another foreach-object and provide a parameter for the &#8220;-Web&#8221; option.\n<\/p>\n<p>\u00a0<br \/>\n\u00a0<\/p>\n<p>Hopefully this helps someone else to save a bit of time in the future.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Very recently I had to change a bunch of accounts from one domain to another in SharePoint. Rather than doing this piecemeal for each individual account, I decided to write a simple script to do this for me. Since I couldn&#8217;t find this online, I figured I&#8217;d demonstrate how I did it. \u00a0 \u00a0 Start &hellip; <a href=\"https:\/\/regroove.ca\/archive\/2017\/02\/16\/how-to-change-the-domain-of-multiple-sharepoint-accounts\/\"><\/a><\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[31,7],"tags":[],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Change the Domain of Multiple SharePoint Accounts - Archive<\/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:\/\/regroove.ca\/archive\/2017\/02\/16\/how-to-change-the-domain-of-multiple-sharepoint-accounts\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Change the Domain of Multiple SharePoint Accounts - Archive\" \/>\n<meta property=\"og:description\" content=\"Very recently I had to change a bunch of accounts from one domain to another in SharePoint. Rather than doing this piecemeal for each individual account, I decided to write a simple script to do this for me. Since I couldn&#8217;t find this online, I figured I&#8217;d demonstrate how I did it. \u00a0 \u00a0 Start &hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/regroove.ca\/archive\/2017\/02\/16\/how-to-change-the-domain-of-multiple-sharepoint-accounts\/\" \/>\n<meta property=\"og:site_name\" content=\"Archive\" \/>\n<meta property=\"article:published_time\" content=\"2017-02-15T20:30:56+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-02-24T21:39:32+00:00\" \/>\n<meta name=\"author\" content=\"Colin Phillips (Alumni)\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Colin Phillips (Alumni)\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/regroove.ca\/archive\/2017\/02\/16\/how-to-change-the-domain-of-multiple-sharepoint-accounts\/\",\"url\":\"https:\/\/regroove.ca\/archive\/2017\/02\/16\/how-to-change-the-domain-of-multiple-sharepoint-accounts\/\",\"name\":\"How to Change the Domain of Multiple SharePoint Accounts - Archive\",\"isPartOf\":{\"@id\":\"https:\/\/regroove.ca\/archive\/#website\"},\"datePublished\":\"2017-02-15T20:30:56+00:00\",\"dateModified\":\"2023-02-24T21:39:32+00:00\",\"author\":{\"@id\":\"https:\/\/regroove.ca\/archive\/#\/schema\/person\/adeb0df1cc7a862160be620ca7eace1b\"},\"breadcrumb\":{\"@id\":\"https:\/\/regroove.ca\/archive\/2017\/02\/16\/how-to-change-the-domain-of-multiple-sharepoint-accounts\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/regroove.ca\/archive\/2017\/02\/16\/how-to-change-the-domain-of-multiple-sharepoint-accounts\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/regroove.ca\/archive\/2017\/02\/16\/how-to-change-the-domain-of-multiple-sharepoint-accounts\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog Archive\",\"item\":\"https:\/\/regroove.ca\/archive\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Change the Domain of Multiple SharePoint Accounts\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/regroove.ca\/archive\/#website\",\"url\":\"https:\/\/regroove.ca\/archive\/\",\"name\":\"Archive\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/regroove.ca\/archive\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/regroove.ca\/archive\/#\/schema\/person\/adeb0df1cc7a862160be620ca7eace1b\",\"name\":\"Colin Phillips (Alumni)\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/regroove.ca\/archive\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/14eeab0d377e9630e0983d9c08911979?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/14eeab0d377e9630e0983d9c08911979?s=96&d=mm&r=g\",\"caption\":\"Colin Phillips (Alumni)\"},\"url\":\"https:\/\/regroove.ca\/archive\/author\/cphillips\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Change the Domain of Multiple SharePoint Accounts - Archive","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:\/\/regroove.ca\/archive\/2017\/02\/16\/how-to-change-the-domain-of-multiple-sharepoint-accounts\/","og_locale":"en_US","og_type":"article","og_title":"How to Change the Domain of Multiple SharePoint Accounts - Archive","og_description":"Very recently I had to change a bunch of accounts from one domain to another in SharePoint. Rather than doing this piecemeal for each individual account, I decided to write a simple script to do this for me. Since I couldn&#8217;t find this online, I figured I&#8217;d demonstrate how I did it. \u00a0 \u00a0 Start &hellip;","og_url":"https:\/\/regroove.ca\/archive\/2017\/02\/16\/how-to-change-the-domain-of-multiple-sharepoint-accounts\/","og_site_name":"Archive","article_published_time":"2017-02-15T20:30:56+00:00","article_modified_time":"2023-02-24T21:39:32+00:00","author":"Colin Phillips (Alumni)","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Colin Phillips (Alumni)","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/regroove.ca\/archive\/2017\/02\/16\/how-to-change-the-domain-of-multiple-sharepoint-accounts\/","url":"https:\/\/regroove.ca\/archive\/2017\/02\/16\/how-to-change-the-domain-of-multiple-sharepoint-accounts\/","name":"How to Change the Domain of Multiple SharePoint Accounts - Archive","isPartOf":{"@id":"https:\/\/regroove.ca\/archive\/#website"},"datePublished":"2017-02-15T20:30:56+00:00","dateModified":"2023-02-24T21:39:32+00:00","author":{"@id":"https:\/\/regroove.ca\/archive\/#\/schema\/person\/adeb0df1cc7a862160be620ca7eace1b"},"breadcrumb":{"@id":"https:\/\/regroove.ca\/archive\/2017\/02\/16\/how-to-change-the-domain-of-multiple-sharepoint-accounts\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/regroove.ca\/archive\/2017\/02\/16\/how-to-change-the-domain-of-multiple-sharepoint-accounts\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/regroove.ca\/archive\/2017\/02\/16\/how-to-change-the-domain-of-multiple-sharepoint-accounts\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Archive","item":"https:\/\/regroove.ca\/archive\/"},{"@type":"ListItem","position":2,"name":"How to Change the Domain of Multiple SharePoint Accounts"}]},{"@type":"WebSite","@id":"https:\/\/regroove.ca\/archive\/#website","url":"https:\/\/regroove.ca\/archive\/","name":"Archive","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/regroove.ca\/archive\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/regroove.ca\/archive\/#\/schema\/person\/adeb0df1cc7a862160be620ca7eace1b","name":"Colin Phillips (Alumni)","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/regroove.ca\/archive\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/14eeab0d377e9630e0983d9c08911979?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/14eeab0d377e9630e0983d9c08911979?s=96&d=mm&r=g","caption":"Colin Phillips (Alumni)"},"url":"https:\/\/regroove.ca\/archive\/author\/cphillips\/"}]}},"_links":{"self":[{"href":"https:\/\/regroove.ca\/archive\/wp-json\/wp\/v2\/posts\/1772"}],"collection":[{"href":"https:\/\/regroove.ca\/archive\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/regroove.ca\/archive\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/regroove.ca\/archive\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/regroove.ca\/archive\/wp-json\/wp\/v2\/comments?post=1772"}],"version-history":[{"count":1,"href":"https:\/\/regroove.ca\/archive\/wp-json\/wp\/v2\/posts\/1772\/revisions"}],"predecessor-version":[{"id":1805,"href":"https:\/\/regroove.ca\/archive\/wp-json\/wp\/v2\/posts\/1772\/revisions\/1805"}],"wp:attachment":[{"href":"https:\/\/regroove.ca\/archive\/wp-json\/wp\/v2\/media?parent=1772"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/regroove.ca\/archive\/wp-json\/wp\/v2\/categories?post=1772"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/regroove.ca\/archive\/wp-json\/wp\/v2\/tags?post=1772"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}