Search code examples
windowsactive-directorysmbsid

What is the easiest way to migrate file permissions (SMB/AD)


I botched a DC's AD / DNS pretty bad over the course of several years (of learning experiences) to the point where I could no longer join or leave the domain with clients. I have a NAS that used to plug into AD via SMB and that is how all the users (my family) used to access their files.

I have recreated my infrastructure configuration from scratch using Windows 2016 using best practices this time around. Is there any way to easily migrate those permissions to users in a new domain/forest (that are equivalent in value to the old one)?

Could I possibly recreate the SIDs / GUIDs of the new users to match the old? I'm assuming no because they have a Windows installation-unique generated string in there.

Could I possibly do this from the NAS side without having to go through each individual's files to change ownership?

Thank you.


Solution

  • One tool you can use to translate permissions from original SIDs to new SIDs is Microsoft's SubInACL

    SubInACL will need from you information which old SID corresponds to which new SID or username and execute translation for all data on NAS server. For example like this

    subinacl /subdirectories "Z:\*.*" /replace=S-1-5-1-2-3-4-5=NEWDOMAIN\newuser
    

    How long it will take for translation to complete depends on number of files and folders, if it's tens of thousands expect hours.

    There are also other tools like SetACL or PowerShell cmdlets Get-Acl/Set-Acl

    You cannot recreate objects with original SIDs and GUIDs unless you're doing restore of the AD infrastructure or cloning/migrating original identities into new ones with original SID in sidHistory attribute.

    So if you're already running domain controller with NAS in newly created forest and old one suffered from issues you wanted fixed that option would be probably much more painful and it's easier to go for SID translation.