{"id":1347,"date":"2023-01-12T15:34:32","date_gmt":"2023-01-12T14:34:32","guid":{"rendered":"https:\/\/www.web-workers.ch\/?p=1347"},"modified":"2023-01-12T20:17:13","modified_gmt":"2023-01-12T19:17:13","slug":"how-to-migrate-local-users-groups-from-microsoft-windows-server-2016-to-2019-2022","status":"publish","type":"post","link":"https:\/\/www.web-workers.ch\/index.php\/2023\/01\/12\/how-to-migrate-local-users-groups-from-microsoft-windows-server-2016-to-2019-2022\/","title":{"rendered":"How to migrate local users \/ groups from Microsoft Windows Server 2016 to 2019\/2022"},"content":{"rendered":"<p>I came across the need to migrate local users and groups from Microsoft Windows Server 2016 to Microsoft Windows Server 2019\/2022.<\/p>\n<ol>\n<li>Install Windows Server Migration Tool, on the source Windows Server 2016 and the target Windows Server 2019\/2022. Start Powershell as administrator and run following commands:\n<div class=\"hcb_wrap\">\n<pre data-lang=\"Plain Text\"><code><span>PS C:\\Users\\Administrator&gt; Import-Module ServerManager\nPS C:\\Users\\Administrator&gt; Add-WindowsFeature Migration\nSuccess Restart Needed Exit Code      Feature Result\n------- -------------- ---------      --------------\nTrue    No             Success        {Windows Server Migration Tools}<\/span><\/code><\/pre>\n<\/div>\n<\/li>\n<li>Share a folder on the target Windows Server 2019\/2022 (for example \\\\192.168.0.1\\UsrMigration)<\/li>\n<li>On the source Windows Server 2016 use the following command to export the local users and groups to the previously created share on the target server (make sure you have authenticated against the share).\n<div class=\"hcb_wrap\">\n<pre data-lang=\"Plain Text\"><code>PS C:\\Users\\Administrator&gt; cd C:\\Windows\\System32\\ServerMigrationTools\\\nPS C:\\Windows\\System32\\ServerMigrationTools&gt; .\\SmigDeploy.exe \/package \/architecture amd64 \/os WS16 \/path \\\\192.168.0.1\\UsrMigration\nSmigDeploy.exe is checking for prerequisites.\n--------------------------------------------------------------------------------\nSmigDeploy.exe is copying Windows Server Migration Tools files to \\\\192.168.0.1\\UsrMigration\\SMT_ws16_amd64.\n--------------------------------------------------------------------------------\nPS C:\\Windows\\system32\\ServerMigrationTools&gt; Add-PSSnapin Microsoft.Windows.ServerManager.Migration\nPS C:\\Windows\\system32\\ServerMigrationTools&gt; Export-SmigServerSetting -User All -Group -Path \\\\192.168.0.1\\UsrMigration -Verbose\n\ncmdlet Export-SmigServerSetting at command pipeline position 1\nSupply values for the following parameters:\nPassword: *******************\n\nItemType ID Success DetailsList\n-------- -- ------- -----------\nOSSetting Local User True {}\nOSSetting Local Group True {}\n\nPS C:\\Windows\\system32\\ServerMigrationTools&gt; echo MyPassword  &gt; \\\\192.168.0.1\\UsrMigration\\Password.txt\n<\/code><\/pre>\n<\/div>\n<\/li>\n<li>Verify the presence of the created files on the previously created share.\n<div class=\"hcb_wrap\">\n<pre data-lang=\"Plain Text\"><code>PS C:\\Windows\\System32\\ServerMigrationTools&gt; dir \\\\192.168.0.1\\UsrMigration\\SMT_ws16_amd64\\\n\n    Directory: \\\\10.0.1.31\\UsrMigration\\SMT_ws16_amd64\n\nMode                LastWriteTime         Length Name\n----                -------------         ------ ----\nd-----       03.09.2021     22:46                en\nd-----       03.09.2021     22:47                replacementmanifests\n-a----       08.01.2021     00:24         175880 cmi2migxml.dll\n-a----       08.01.2021     00:26         662280 csiagent.dll\n-a----       03.09.2021     22:37        8417280 Microsoft.Windows.ServerManager.Migration.dll\n-a----       08.01.2021     00:24        8291080 migcore.dll\n-a----       08.01.2021     00:20         270736 mighost.exe\n-a----       16.07.2016     15:19          16224 migres.dll\n-a----       08.01.2021     00:24        1188104 migstore.dll\n-a----       08.01.2021     00:25         312592 MXEAgent.dll\n-a----       16.07.2016     15:19            228 ServerMigration.psc1\n-a----       16.07.2016     15:19           1824 SFCN.dat\n-a----       16.07.2016     15:19           1644 SFLCID.dat\n-a----       16.07.2016     15:19        3348038 SFLISTLH.dat\n-a----       16.07.2016     15:19        5590872 SFLISTRS1.dat\n-a----       16.07.2016     15:19        1703322 SFLISTW7.dat\n-a----       16.07.2016     15:19        2608968 SFLISTW8.dat\n-a----       16.07.2016     15:19        3173014 SFLISTWB.dat\n-a----       16.07.2016     15:19        4935856 SFLISTWT.dat\n-a----       16.07.2016     15:19        1459266 SFLISTXP.dat\n-a----       16.07.2016     15:19          11345 SFPAT.inf\n-a----       16.07.2016     15:19           8678 SFPATLH.inf\n-a----       16.07.2016     15:19         169643 SFPATRS1.inf\n-a----       16.07.2016     15:19          17117 SFPATW7.inf\n-a----       16.07.2016     15:19          79539 SFPATW8.inf\n-a----       16.07.2016     15:19          91356 SFPATWB.inf\n-a----       16.07.2016     15:19         165630 SFPATWT.inf\n-a----       16.07.2016     15:19           4355 SFPATXP.inf\n-a----       03.09.2021     22:37          81920 SmigDeploy.exe\n-a----       03.09.2021     22:37         719360 svrmig.dll\n-a----       25.10.2018     06:02        1098176 unbcl.dll\n-a----       03.09.2021     22:37         249696 wdscore.dll<\/code><\/pre>\n<\/div>\n<\/li>\n<li>On the destination Windows Server 2019\/2022 open the Windows Server Migration Tool. Start Powershell as administrator and run following commands.\n<div class=\"hcb_wrap\">\n<pre data-lang=\"Plain Text\"><code>cmd.exe\n%windir%\\system32\\WindowsPowershell\\v1.0\\powershell.exe -psconsolefile %windir%\\system32\\ServerMigrationTools\\ServerMigration.psc1\nPS C:\\Users\\Administrator&gt; cd C:\\Windows\\System32\\<\/code><code>PS C:\\Windows\\System32&gt; Import-SmigServerSetting -User Enabled -Group -Path \\\\192.168.0.1\\UsrMigration -Verbose<\/code><\/pre>\n<\/div>\n<\/li>\n<li>After the files has been imported, check the presence of the users and verify the SID of the objects.\n<p>Source:<\/p>\n<div class=\"hcb_wrap\">\n<pre data-lang=\"Plain Text\"><code>PS C:\\Windows\\System32&gt; wmic useraccount get name,sid\nName SID\nXXXXXXXXXX S-1-5-21-4115556112-3171488497-xxxxxxxxx-500\nXXXXXXXXXX S-1-5-21-4115556112-3171488497-xxxxxxxxx-1002\nXXXXXXXXXX S-1-5-21-4115556112-3171488497-xxxxxxxxx-1003\nXXXXXXXXXX S-1-5-21-4115556112-3171488497-xxxxxxxxx-1005\nXXXXXXXXXX S-1-5-21-4115556112-3171488497-xxxxxxxxx-1006\nXXXXXXXXXX S-1-5-21-4115556112-3171488497-xxxxxxxxx-1007\nXXXXXXXXXX S-1-5-21-4115556112-3171488497-xxxxxxxxx-1008\nXXXXXXXXXX S-1-5-21-4115556112-3171488497-xxxxxxxxx-503\nXXXXXXXXXX S-1-5-21-4115556112-3171488497-xxxxxxxxx-501\nXXXXXXXXXX S-1-5-21-4115556112-3171488497-xxxxxxxxx-1009\nXXXXXXXXXX S-1-5-21-4115556112-3171488497-xxxxxxxxx-1055\nXXXXXXXXXX S-1-5-21-4115556112-3171488497-xxxxxxxxx-1010\nXXXXXXXXXX S-1-5-21-4115556112-3171488497-xxxxxxxxx-1054\nXXXXXXXXXX S-1-5-21-4115556112-3171488497-xxxxxxxxx-1044\nXXXXXXXXXX S-1-5-21-4115556112-3171488497-xxxxxxxxx-1056\nXXXXXXXXXX S-1-5-21-4115556112-3171488497-xxxxxxxxx-1001\nXXXXXXXXXX S-1-5-21-4115556112-3171488497-xxxxxxxxx-1000\n<\/code><\/pre>\n<\/div>\n<p>Target:<\/p>\n<div class=\"hcb_wrap\">\n<pre data-lang=\"Plain Text\"><code>PS C:\\Windows\\System32&gt; wmic useraccount get name,sid\nName SID\nXXXXXXXXXX S-1-5-21-4115556112-3171488497-xxxxxxxxx-500\nXXXXXXXXXX S-1-5-21-4115556112-3171488497-xxxxxxxxx-1002\nXXXXXXXXXX S-1-5-21-4115556112-3171488497-xxxxxxxxx-1003\nXXXXXXXXXX S-1-5-21-4115556112-3171488497-xxxxxxxxx-1005\nXXXXXXXXXX S-1-5-21-4115556112-3171488497-xxxxxxxxx-1006\nXXXXXXXXXX S-1-5-21-4115556112-3171488497-xxxxxxxxx-1007\nXXXXXXXXXX S-1-5-21-4115556112-3171488497-xxxxxxxxx-1008\nXXXXXXXXXX S-1-5-21-4115556112-3171488497-xxxxxxxxx-503\nXXXXXXXXXX S-1-5-21-4115556112-3171488497-xxxxxxxxx-501\nXXXXXXXXXX S-1-5-21-4115556112-3171488497-xxxxxxxxx-1009\nXXXXXXXXXX S-1-5-21-4115556112-3171488497-xxxxxxxxx-1055\nXXXXXXXXXX S-1-5-21-4115556112-3171488497-xxxxxxxxx-1010\nXXXXXXXXXX S-1-5-21-4115556112-3171488497-xxxxxxxxx-1054\nXXXXXXXXXX S-1-5-21-4115556112-3171488497-xxxxxxxxx-1044\nXXXXXXXXXX S-1-5-21-4115556112-3171488497-xxxxxxxxx-1056\nXXXXXXXXXX S-1-5-21-4115556112-3171488497-xxxxxxxxx-1001\nXXXXXXXXXX S-1-5-21-4115556112-3171488497-xxxxxxxxx-1000<\/code><\/pre>\n<\/div>\n<\/li>\n<\/ol>\n<p>Note: After the users was imported on the target server, those accounts are locked and have the attribute set to change the password after the first login &#8211; remove those attributes on the user objects if required.<\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>I came across the need to migrate local users and groups from Microsoft Windows Server 2016 to Microsoft Windows Server 2019\/2022. Install Windows Server Migration Tool, on the source Windows [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1693,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[3],"tags":[176,29,175,28],"class_list":["post-1347","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mswin","tag-migration","tag-server","tag-users","tag-windows"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.web-workers.ch\/wp-content\/uploads\/2023\/01\/user_migration.png?fit=970%2C412&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8sxjX-lJ","jetpack-related-posts":[],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.web-workers.ch\/index.php\/wp-json\/wp\/v2\/posts\/1347","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.web-workers.ch\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.web-workers.ch\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.web-workers.ch\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.web-workers.ch\/index.php\/wp-json\/wp\/v2\/comments?post=1347"}],"version-history":[{"count":25,"href":"https:\/\/www.web-workers.ch\/index.php\/wp-json\/wp\/v2\/posts\/1347\/revisions"}],"predecessor-version":[{"id":1700,"href":"https:\/\/www.web-workers.ch\/index.php\/wp-json\/wp\/v2\/posts\/1347\/revisions\/1700"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.web-workers.ch\/index.php\/wp-json\/wp\/v2\/media\/1693"}],"wp:attachment":[{"href":"https:\/\/www.web-workers.ch\/index.php\/wp-json\/wp\/v2\/media?parent=1347"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.web-workers.ch\/index.php\/wp-json\/wp\/v2\/categories?post=1347"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.web-workers.ch\/index.php\/wp-json\/wp\/v2\/tags?post=1347"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}