Checking Folder Ownership and Permissions in VBScript

Checking Folder Ownership and Permissions in VBScript

Secure Home | Search | About
 Microsoft Applications Security    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content add this group's latest topics to your Google content
Subject Author Date
Checking Folder Ownership and Permissions in VBScript john.hundley 11-11-2005
Posted by john.hundley on November 11, 2005, 2:50 pm
If you were  Registered and logged in, you could reply and use other advanced thread options
Can anyone tell me how I can get the ownership and permissions on a folder
using VBScript? xcacls does not give ownership and the way it outputs the
permissions is crap.
Thanks,
John

Posted by Steven L Umbach on November 11, 2005, 6:48 pm
If you were  Registered and logged in, you could reply and use other advanced thread options
Did you try xcacls.vbs?? If you do not like that then take a look at
fileacl. --- Steve

http://support.microsoft.com/?id=825751

Example of command to show permissions for folders in the system drive.

cscript d:\windows\xcacls.vbs %systemdrive%\ /s

Example of output.

**************************************************************************
Directory: D:\temp1

Permissions:
Type Username Permissions Inheritance

Allowed BUILTIN\Administrators Full Control This Folder Only
Allowed BUILTIN\Administrators Full Control This Folder, Subfolde
Allowed \CREATOR OWNER Full Control Subfolders and Files
Allowed \Everyone Read This Folder, Subfolde
Allowed NT AUTHORITY\SYSTEM Full Control This Folder, Subfolde
Allowed BUILTIN\Users Read and Execute This Folder, Subfolde
Allowed BUILTIN\Users Special (E2) This Folder and Subfo
Allowed BUILTIN\Users Special (E3) This Folder and Subfo

No Auditing set

Owner: BUILTIN\Administrators

> Can anyone tell me how I can get the ownership and permissions on a folder
> using VBScript? xcacls does not give ownership and the way it outputs the
> permissions is crap.
> Thanks,
> John



Posted by Roger Abell [MVP] on November 12, 2005, 1:09 am
If you were  Registered and logged in, you could reply and use other advanced thread options
The wmi methods are the most direct.
Download the xcacls.vbs script Steve has mentioned as it
has examples of all the needed processing - but, a word of
warning, it is rather involved to roll your own as you are walking
structures a could layers deep off a list of root nodes while at
same time trying to "summarize" in human readable form.

--
Roger Abell
Microsoft MVP (Windows Server : Security)
MCDBA, MCSE W2k3+W2k+Nt4
> Can anyone tell me how I can get the ownership and permissions on a folder
> using VBScript? xcacls does not give ownership and the way it outputs the
> permissions is crap.
> Thanks,
> John



Similar ThreadsPosted
Folder permissions and take ownership July 14, 2008, 8:00 pm
Folder Ownership October 10, 2005, 12:38 pm
Cannot take ownership of a folder January 31, 2006, 6:47 am
Folder permissions April 26, 2007, 9:28 am
Folder permissions October 25, 2007, 6:26 pm
Folder permissions November 5, 2007, 8:17 am
Folder Permissions September 6, 2008, 2:54 pm
Permissions on created folder July 28, 2005, 12:37 pm
Remove all permissions from folder February 13, 2006, 5:25 am
Setting Folder Permissions????? March 17, 2006, 12:40 pm

The site map in XML format XML site map

Contact Us | Privacy Policy