This task can be done via copy tools easily and effectively such as Teracopy , Gs Richcopy 360 and Freefilesync , all can help to copy files from source to destination with preserving shared/NTFS permissions .
Also you can check the below PowerShell script for handling this issue
$sourceFile = "C:\path\to\run.bat"
$destinationFolder = "\\computer1\share\folder"
$computers = @("computer1", "computer2", "computer3")
foreach ($computer in $computers) {
$destinationPath = "\\$computer\$destinationFolder"
# Copy the file to the destination folder
Copy-Item -Path $sourceFile -Destination $destinationPath -Force
# Get the source file's ACL
$acl = Get-Acl -Path $sourceFile
# Set the destination file's ACL to match the source file's ACL
$destinationFile = Join-Path -Path $destinationPath -ChildPath (Split-Path -Leaf $sourceFile)
Set-Acl -Path $destinationFile -AclObject $acl
}
Note :
-
$sourceFile
: The path to therun.bat
file on your local machine. -
$destinationFolder
: The shared folder path on the remote computers where you want to copy the file. -
$computers
: An array of the names of the domain joined computers where you want to copy the file.
I hope these info help