Migrate Windows File Server

Microsoft File Server migration in my case consisted of 3 steps:

  1. Copy files (including NTFS permissions)
  2. Copy shares
  3. Copy quotas

Here is what to do:

Copy files using robocopy

i copied files from my old to new server using following command on the source server:

robocopy.exe .\MyRootFolder \\MyDestinationServer\driveletter$\MyRootFolder /MIR /SEC /SECFIX /W:3 /R:3 /E /ZB /COPYALL /V

To learn more about the parameters, go to this microsoft page for robocopy

Copy shares

Use regedit to export / import following key and its content:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanServer\Shares

Copy quotas

Now this was the most complicated part as it involved some scripting. First export the quota templates from the source server:

dirquota.exe quota template export /file:C:\quota.xml

copy that file onto the destination server and do:

dirquota.exe quota template import /file:<path_to_xml_file>

Afterwards you have to output the specific quotas and add them with:

dirquota.exe quota add /Limit:<size_in_gb_or_mb> /SourceTemplate:<name_of_the_template> /Path:<path_to_quota_folder>

Source: https://suddhaman.blogspot.com/2020/07/file-server-migration-windows-server.html

Install Let’s Encrypt certificate on Microsoft Exchange

Download the ACME client for windows here:

https://www.win-acme.com

then unzip it into a directory, e.g. C:\win-acme and change into that directory. then paste the following command (but make sure to change the needed parameters before executing):

.\wacs.exe --source manual --host "mail.example.com,autodiscover.example.com" --certificatestore My --acl-fullcontrol "network service,administrators" --installation "iis,script" --installationsiteid 1 --script "./Scripts/ImportExchange.v2.ps1" --scriptparameters "'{CertThumbprint}' 'IIS,SMTP,IMAP,POP' 1 '{CacheFile}' '{CachePassword}' '{CertFriendlyName}'"

In this example we want a certificate for mail.example.com and autodiscover.example.com for the services IIS, SMTP, IMAP and POP. Important note for Hybrid Exchange configurations (synced to Office 365): you should use 0 instead of 1 in the --scriptparameters, which translates to the LeaveOldExchangeCerts input of the sample script.

More infos about this: https://www.win-acme.com/manual/advanced-use/examples/exchange