Changing permissions on a shared folder in Windows is one wrong click away from locking people out. icacls can save the current state first.
icacls D:\Share\* /save D:\acl-backup.txt /t
/save stores the ACLs of all matching files in a file for later use with /restore, and /t includes everything in the subfolders. If things go wrong:
icacls D:\Share\ /restore D:\acl-backup.txt
Note the difference: the docs say /restore needs the directory, not the wildcard.
To look at permissions, icacls D:\Share on its own shows the current ACL. To give a user modify rights on a folder and everything below it:
icacls D:\Share /grant alice:(OI)(CI)M
M is modify access, and (OI)(CI) are the inheritance flags that make it apply to files and subfolders. Use /grant:r to replace a user’s existing explicit rights instead of adding to them.
Caveats. Keep the backup file outside the folder you are changing. /reset /t replaces the ACLs with the default inherited ones for everything below, which is a quick way to undo a mess and also to throw away rights you meant to keep, so save first. icacls replaces the old cacls command, so ignore guides that still use that one.
Further reading: icacls on Microsoft Learn