Click here to get back home

Code to remove a user group from file or folder ACL

 HomeNewsGroups | Search | About
 microsoft.public.windows.server.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
Subject Author Date
Code to remove a user group from file or folder ACL Michael via WinServerKB.com 03-22-2006
Posted by Michael via WinServerKB.com on March 22, 2006, 1:45 pm
Please log in for more thread options
I'm using subinacl.exe to download file permissions on a server. Then, we
edit certain permissions once a week. However, I need to know how to remove
using VBA code a "unwanted" user group that oftens gets added to a file or
folder when someone by mistake checks inherit from parent. Most of the time
this group is "everyone". How can I using code to remove "everyone" from a
folder acl. Is there a utility or another program like subinacl.exe that can
do the job?

--
Message posted via http://www.winserverkb.com

Posted by Roger Abell [MVP] on March 23, 2006, 2:41 am
Please log in for more thread options
Check out xcacls.vbs which you can obtain from search on the
filename (note: that is .vbs) at microsoft.com/downloads
This VBscript file examples pretty much any possible ACL
manipulation. Also, you could look into fileacl from sourceforge.

> I'm using subinacl.exe to download file permissions on a server. Then, we
> edit certain permissions once a week. However, I need to know how to
> remove
> using VBA code a "unwanted" user group that oftens gets added to a file or
> folder when someone by mistake checks inherit from parent. Most of the
> time
> this group is "everyone". How can I using code to remove "everyone" from
> a
> folder acl. Is there a utility or another program like subinacl.exe that
> can
> do the job?
>
> --
> Message posted via http://www.winserverkb.com



Posted by musenyin via WinServerKB.com on March 23, 2006, 8:42 am
Please log in for more thread options
I looked into xcacls.vbs, but am not sure that this will do what I want.
Switch /R will revoke specified user's access rights, but not remove the user
group. For example: my program will download file permission for a file on
day 1. The user groups are "administrators", "system", "lg_processors", and
"xnn8tty". On day 7 I perform the same download and now there are 5 user
groups because "everyone" is now present besides the prior four. This is
usually caused by the user checking the inherit from parent box on the
advance permission tab. What I need to know is how to delete/remove
"everyone" user group from that file using vb code and not set revoke
permission or remove it using the remove button on the advanced tab. I
thought about using /net command remove user, but I believe that will delete
everyone from all files in my domain. Your help is greatly appreciated.

Roger Abell [MVP] wrote:
>Check out xcacls.vbs which you can obtain from search on the
>filename (note: that is .vbs) at microsoft.com/downloads
>This VBscript file examples pretty much any possible ACL
>manipulation. Also, you could look into fileacl from sourceforge.
>
>> I'm using subinacl.exe to download file permissions on a server. Then, we
>> edit certain permissions once a week. However, I need to know how to
>[quoted text clipped - 7 lines]
>> can
>> do the job?

--
Message posted via WinServerKB.com
http://www.winserverkb.com/Uwe/Forums.aspx/windows-server-security/200603/1

Posted by Roger Abell [MVP] on March 23, 2006, 10:13 am
Please log in for more thread options
in xcacls where the docs indicate that you provide a user they really
mean that you provide a principal, whether that be a user account or
a group. It really sounds like your copy should be tweaked so that
it is sensitive to whether a grant it is considering copying onto the
copied-down file is an explicit or an inherited and then only copy
the explicit.

>I looked into xcacls.vbs, but am not sure that this will do what I want.
> Switch /R will revoke specified user's access rights, but not remove the
> user
> group. For example: my program will download file permission for a file
> on
> day 1. The user groups are "administrators", "system", "lg_processors",
> and
> "xnn8tty". On day 7 I perform the same download and now there are 5 user
> groups because "everyone" is now present besides the prior four. This is
> usually caused by the user checking the inherit from parent box on the
> advance permission tab. What I need to know is how to delete/remove
> "everyone" user group from that file using vb code and not set revoke
> permission or remove it using the remove button on the advanced tab. I
> thought about using /net command remove user, but I believe that will
> delete
> everyone from all files in my domain. Your help is greatly appreciated.
>
> Roger Abell [MVP] wrote:
>>Check out xcacls.vbs which you can obtain from search on the
>>filename (note: that is .vbs) at microsoft.com/downloads
>>This VBscript file examples pretty much any possible ACL
>>manipulation. Also, you could look into fileacl from sourceforge.
>>
>>> I'm using subinacl.exe to download file permissions on a server. Then,
>>> we
>>> edit certain permissions once a week. However, I need to know how to
>>[quoted text clipped - 7 lines]
>>> can
>>> do the job?
>
> --
> Message posted via WinServerKB.com
> http://www.winserverkb.com/Uwe/Forums.aspx/windows-server-security/200603/1



Similar ThreadsPosted
Can't remove user from administrator group November 11, 2005, 2:47 pm
Remove List Folder access only? March 16, 2006, 2:18 am
Remove Administrator Rights from Folder in Win2k Server November 11, 2005, 9:44 am
Re: Windows Media Player Remote Code Execution (923689) - sfpcopy. - sfpcopy.ex_ (0 Part File) July 6, 2007, 7:09 pm
failed/successfull audit delete folder and delete file and folder November 15, 2006, 8:12 am
Using CREATOR GROUP for files/folder July 11, 2005, 10:43 am
determine folder permission for group February 2, 2007, 5:01 am
Unexpected security restriction for a user in both a user and administrative group. April 24, 2008, 10:05 pm
File/Folder Permissions October 31, 2006, 4:25 pm
File/Folder encryption - Compliancy with PCI September 28, 2005, 10:31 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap