Windows permissions migration

  • Thread starter Thread starter JPK
  • Start date Start date
J

JPK

Does anyone know of a utility, program, or way of migrating share
permissions to NTFS permissions? Basically I want to export the
permissions that are on several shares, then import those same settings
to the NTFS permssions on the same folder.
 
Does anyone know of a utility, program, or way of migrating share
permissions to NTFS permissions? Basically I want to export the
permissions that are on several shares, then import those same settings
to the NTFS permssions on the same folder.

See tip 6353 » RMTShare.exe is in the public domain.
in the 'Tips & Tricks' at http://www.jsifaq.com

See tip 8225 » The Extended Change Access Control List tool (Xcacls.vbs) has been enhanced and replaces Xcacls.exe.

Here is a batch that takes multiple shares and extracts the share perms. You can then feed it to cacls or xcacls.vbs

mybatch \\computer1\share1 \\computer1\share2 \\computer1\share3


@echo off
setlocal EnableDelayedExpansion
:loop
if {%1}=={} goto finish
set no=FIND /V /I "The command completed successfully."
for /f "Tokens=1,2" %%e in ('rmtshare %1^|find "Path"') do (
@echo %1 "%%f"
)
for /f "Skip=6 Tokens=*" %%a in ('rmtshare %1^|%no%') do (
for /f "Tokens=1,2 Delims=:" %%b in ('@echo %%a') do (
set usr="%%b"
set prm="%%c"
)
set usr=!usr: =!
set usr=!usr:" ="!
set usr=!usr: "="!
set prm=!prm: =!
set prm=!prm:" ="!
set prm=!prm: "="!
@echo %1 !usr! !prm!
)
shift
goto loop
:finish
endlocal

Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com
http://www.jsifaq.com
 
Back
Top