{"id":3445,"date":"2018-05-02T20:06:41","date_gmt":"2018-05-02T19:06:41","guid":{"rendered":"http:\/\/www.edwardsd.co.uk\/work\/?p=3445"},"modified":"2018-05-15T13:39:03","modified_gmt":"2018-05-15T12:39:03","slug":"migrate-folder-shares-powershell","status":"publish","type":"post","link":"https:\/\/www.edwardsd.co.uk\/work\/2018\/05\/migrate-folder-shares-powershell\/","title":{"rendered":"Migrate Folder Shares | PowerShell"},"content":{"rendered":"<p>Basic objective, we&#8217;ve got a ton of shares which we need to move to a new server. The data has already been replicated but we need to re-share.<br \/>\nThere are methods of doing this by exporting the registry but being a little scared of messing up the current shares and requiring a reboot I decided to do this manually&#8230;<\/p>\n<p><strong>Export list of shares on source server:<\/strong><\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">get-WmiObject -class Win32_Share -computer servername.fqdn.com | Export-Csv -Path &quot;C:\\Shares.csv&quot;<\/pre>\n<p><strong>Create shares on destination server:<\/strong><\/p>\n<p><strong>Powershell:<\/strong><\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">Need the powershell command here<\/pre>\n<p><strong>CMD Net Share<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">net share &quot;ShareName&quot;=&quot;D:\\Path\\FolderName&quot; \/grant:everyone,FULL<\/pre>\n<p><strong>Reference:<\/strong><br \/>\nhttps:\/\/docs.microsoft.com\/en-us\/powershell\/module\/microsoft.powershell.utility\/export-csv?view=powershell-6<br \/>\nhttps:\/\/gallery.technet.microsoft.com\/scriptcenter\/Creates-New-Share-with-fb22d905<br \/>\nhttp:\/\/www.tomsitpro.com\/articles\/use-fileshare-powershell-cmdlets-server-2016,2-1053.html<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Basic objective, we&#8217;ve got a ton of shares which we need to move to a new server. The data has already been replicated but we need to re-share. There are methods of doing this by exporting the registry but being a little scared of messing up the current shares and requiring a reboot I decided [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"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":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[30,23,44],"tags":[],"class_list":["post-3445","post","type-post","status-publish","format-standard","hentry","category-powershell","category-windows-server-2008","category-windows-server-2012"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pOPt8-Tz","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.edwardsd.co.uk\/work\/wp-json\/wp\/v2\/posts\/3445","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.edwardsd.co.uk\/work\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.edwardsd.co.uk\/work\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.edwardsd.co.uk\/work\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.edwardsd.co.uk\/work\/wp-json\/wp\/v2\/comments?post=3445"}],"version-history":[{"count":11,"href":"https:\/\/www.edwardsd.co.uk\/work\/wp-json\/wp\/v2\/posts\/3445\/revisions"}],"predecessor-version":[{"id":3509,"href":"https:\/\/www.edwardsd.co.uk\/work\/wp-json\/wp\/v2\/posts\/3445\/revisions\/3509"}],"wp:attachment":[{"href":"https:\/\/www.edwardsd.co.uk\/work\/wp-json\/wp\/v2\/media?parent=3445"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.edwardsd.co.uk\/work\/wp-json\/wp\/v2\/categories?post=3445"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.edwardsd.co.uk\/work\/wp-json\/wp\/v2\/tags?post=3445"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}