Jesper M. Christensen

SharePoint and Security

Using command-line and scripts to set NTFS permissions


Sometimes we need to script NTFS-rights for use in unattended/silent installations or simply set permissions during user-logon. Microsoft have the script you need for this and it is called Extended Change Access Control List Tool (Xcacls).

You can download the vb-script here:
http://www.microsoft.com/downloads/thankyou.aspx?familyId=0ad33a24-0616-473c-b103-c35bc2820bda&displayLang=en

I have included a couple of examples below, but more information can be found at Microsoft Knowledge Database KB825751.

Batch/Command file example

@ECHO OFF
CALL cscript "\\server\share\xcacls.vbs" "%programfiles%\My Program Folder" /t /e /G DOMAIN\ADMINISTRATOR:F /G DOMAIN\USERNAME:RCEW

VB Script

Set shell = CreateObject("WScript.Shell")
shell.run "xcacls.vbs ""%programfiles%\My Program Folder"" /T /E /G DOMAIN\USERNAME:F /Q"

Advertisements

2 responses to “Using command-line and scripts to set NTFS permissions

  1. Online Streetwear January 6, 2013 at 05:37

    Interesting blog! Is your theme custom made or did you
    download it from somewhere? A theme like yours with a
    few simple adjustements would really make my blog jump out.
    Please let me know where you got your design.
    Cheers

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: