Admin Scripts: How to assign NTFS permission from Network Share using ICACLS

Well, we know that we can assign NTFS permission from local machine using ICACLS command.

How about assigning NTFS permission from share folder? The answer is yes, you can.

Sample Share Folder Structure:

ICACLS_0001

Steps:

S1-1. In Share folder, make sure the administrator who is executed script has Share Permission at least Read and has Full NTFS permission. Fail to set this permission will result in Access is denied.

C:\>ICACLS "\\TLDFSRS1N1\Share1\Notes\Doc1" /GRANT "TestLab\TestUserAndy:M"
\\TLDFSRS1N1\Share1\Notes\Doc1: Access is denied.
Successfully processed 0 files; Failed processing 1 files

S1-2. To assign NTFS permission using ICACLS for a single folder/file

C:\>ICACLS "\\TLDFSRS1N1\Share1\Notes\Doc1" /GRANT "TestLab\TestUserAndy:M"
processed file: \\TLDFSRS1N1\Share1\Notes\Doc1
Successfully processed 1 files; Failed processing 0 files

ICACLS_0002a
ICACLS_0002b

S1-3. To assign NTFS permission using ICACLS with Inheritance

C:\>ICACLS "\\TLDFSRS1N1\Share1\Notes\Doc1" /GRANT "TestLab\TestUserAndy:(CI)(OI)M"
processed file: \\TLDFSRS1N1\Share1\Notes\Doc1
Successfully processed 1 files; Failed processing 0 files

ICACLS_0003a
ICACLS_0003b

 

Leave a Reply

Your email address will not be published. Required fields are marked *

16 − thirteen =

YLNotes: Yunlong Notes © 2017 Frontier Theme