Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 30-07-2009
Member
 
Join Date: Jun 2009
Posts: 18
Post need vbscript to pull explicit assigned permission on folder which are not inherited

hi everyone ,

i need a script which list me ACL enteries whose permission are explicitly assigned and not inherited is there anyway in which i can do that, how can i get that,

i am having folder in C:\ drive named AAA whose inheritance permission are disabled to the child folder ,i am creating folder named BBB under AAA and i am adding explicit permissions to one of the user (eg:vivek) to BBB folder when i look at the Advanced setting of the folder security permission i will get the following on ACL entries list

Type: Name: Permission: inheritedfrom: Applyto:

Allow vivek.M FullControl <not inherited> this folder ,subFolder,files

Allow System FullControl C:\AAA this folder ,subFolder,files


i need to pull or get only the first line of result whose inheritedfrom: are <not inherited>

important vivek.m is explicty assigned to the particular folder by using ADD fuction on Advance security tab


how can i get reply me............
Reply With Quote
  #2  
Old 30-07-2009
Member
 
Join Date: May 2008
Posts: 33
Re: need vbscript to pull explicit assigned permission on folder which are not inherited

To set folder permissions in VBScript

Code:
'This script will assign Modify/C-Change (write) Permission To Power User on "C:\MyFolder" using cacls on NTFS formatted drive

Dim oShell, FoldPerm, Calcds, oFSO

Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oShell = CreateObject("WScript.Shell")

sSysDir = oFSO.GetSpecialFolder(1).Path
If Right(sSysDir,1) <> "\" Then sSysDir = sSysDir & "\"

Calcds = sSysDir & "cacls.exe" 

'Chang The folder Name, User and Access rights in the following line of code  

FoldPerm = """" & Calcds &"""" & """C:\MyFolder""" & " /E /T /C /G " & """Power Users""" & ":C" 

oShell.Run FoldPerm, 1 ,True
Grant Permission
Reply With Quote
  #3  
Old 30-07-2009
Member
 
Join Date: May 2008
Posts: 44
Re: need vbscript to pull explicit assigned permission on folder which are not inherited

Have you tried Windows Management Instrumentation (WMI)
http://msdn.microsoft.com/library/de...itysetting.asp

Please have a look at Microsoft
1. http://support.microsoft.com/default...b;en-us;266461
2. http://support.microsoft.com/default...b;en-us;269159

I hope this helps you.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "need vbscript to pull explicit assigned permission on folder which are not inherited"
Thread Thread Starter Forum Replies Last Post
Maybe a VBScript to pull email addresses? Modom Active Directory 1 03-08-2011 04:21 PM
how to pull local group members in vbscript? vivekmohan Software Development 3 25-07-2009 01:52 PM
how to pull NTFS security permission in vbscript vivekmohan Software Development 3 25-07-2009 01:28 PM
How to Change Permission in VBScript Quattro Software Development 3 09-06-2009 08:44 AM
Microsoft VBScript runtime error: Permission denied: 'GetObject' Swati_here_2008 Software Development 3 05-05-2008 01:57 PM


All times are GMT +5.5. The time now is 10:58 PM.