Results 1 to 4 of 4

Thread: how to pull NTFS security permission in vbscript

  1. #1
    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.

  2. #2
    Join Date
    Oct 2005
    Posts
    2,393

    Re: how to pull NTFS security permission in vbscript

    Dude are you searching for this
    http://support.microsoft.com/kb/825751

  3. #3
    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

  4. #4
    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

Similar Threads

  1. Maybe a VBScript to pull email addresses?
    By Modom in forum Active Directory
    Replies: 1
    Last Post: 03-08-2011, 04:21 PM
  2. Replies: 2
    Last Post: 30-07-2009, 05:14 PM
  3. how to pull local group members in vbscript?
    By vivekmohan in forum Software Development
    Replies: 3
    Last Post: 25-07-2009, 01:52 PM
  4. How to Change Permission in VBScript
    By Quattro in forum Software Development
    Replies: 3
    Last Post: 09-06-2009, 08:44 AM
  5. Microsoft VBScript runtime error: Permission denied: 'GetObject'
    By Swati_here_2008 in forum Software Development
    Replies: 3
    Last Post: 05-05-2008, 01:57 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,283,988.74055 seconds with 17 queries