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 24-07-2009
Member
 
Join Date: Jun 2009
Posts: 18
Post how to pull NTFS security permission in vbscript

hi everyone,

i am looking for script which fetch me all NTFS permission on the folder, NTFS permission should be exclipt and not inherited (how do i check this?), what is curical is i will be given only server name as input , from that server i need to pull all NTFS Permission,

in short my script need to pull server physical NTFS permission which are explicitly assigned, not inherited,script which also need to provide path where folder are located.
Reply With Quote
  #2  
Old 24-07-2009
Member
 
Join Date: Oct 2005
Posts: 2,389
Re: how to pull NTFS security permission in vbscript

Dude are you searching for this
http://support.microsoft.com/kb/825751
Reply With Quote
  #3  
Old 25-07-2009
Member
 
Join Date: Jun 2009
Posts: 18
sad Re: how to pull NTFS security permission in vbscript

hi reegan
will you please help me !!!!!!!

i am tried using Xcacls , when i am using it command prompt it pulls me full result but when i run xcalcs through vbscript it gives me only the first value.

for example :



if i want to get the result for the folder c:\Test when i run it on command prompt it give me



C:\Documents and Settings\rz82nr>xcacls c:\Deltest

c:\Deltest BUILTIN\AdministratorsOI)(CI)F

NT AUTHORITY\SYSTEMOI)(CI)F

GMDEV\pzdx5c:F

CREATOR OWNEROI)(CI)(IO)F

BUILTIN\UsersOI)(CI)R

BUILTIN\UsersCI)(special access

FILE_APPEND_DATA

BUILTIN\UsersCI)(special access

FILE_WRITE_DATA



but when i run the xcacls i gives me only the first line of output

c:\Deltest BUILTIN\AdministratorsOI)(CI)F



how can i get the whole output i am giving my script here remodify the script and help me to get the output



Option Explicit

Dim objItem,objShell,objWshScriptExec,objStdOut,strline

Dim oWshNet: Set oWshNet = CreateObject("WScript.Network" )

Dim strComputer: strComputer = oWshNet.ComputerName

Dim objWMIService: Set objWMIService = GetObject(_

"winmgmts:\\" & strComputer & "\root\CIMV2")

Const FilePath1 = "c:\Deltest"

Const Filepath2 ="c:\Documents and Settings\rz82nr\Desktop\Deltest.txt"

Dim objFSO,objFile,objFile1,i,item

Set objFSO = CreateObject("Scripting.FileSystemObject")

Set objFile1 = objFSO.CreateTextFile(FilePath2, True)

With objWMIService: Dim strQuery

Set objShell = CreateObject("WScript.Shell")

strQuery = "Xcacls" & Chr(32)& FilePath1

Set objWshScriptExec = objShell.Exec(strQuery)

Set objStdOut = objWshScriptExec.StdOut

strline=objStdOut.ReadLine

MsgBox strline

objFile1.WriteLine(strline)

End With
Reply With Quote
  #4  
Old 25-07-2009
Member
 
Join Date: Mar 2009
Posts: 2
ThumbsUp Re: how to pull NTFS security permission in vbscript

Hi,

icacls c:\windows\* /save AclFile /T ? Substitute ?C:\Windows? with the folder where you have the files for taking the ACLs backup


- Will save the ACLs for all files under c:\windows and its subdirectories to AclFile.

icacls c:\windows\ /restore AclFile ? Substitute ?C:\Windows? with the destination folder on which you want to restore the backed up ACLs

- Will restore the ACLs for every file within AclFile that exists in c:\windows and its subdirectories
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "how to pull NTFS security permission in vbscript"
Thread Thread Starter Forum Replies Last Post
Maybe a VBScript to pull email addresses? Modom Active Directory 1 03-08-2011 04:21 PM
need vbscript to pull explicit assigned permission on folder which are not inherited vivekmohan Software Development 2 30-07-2009 05:14 PM
how to pull local group members in vbscript? vivekmohan Software Development 3 25-07-2009 01:52 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 11:27 AM.