|
After reading through MANY MANY posts... I'm wondering if anyone has found a way to call the Win32_LogicalFileSecuritySetting GetSecurityDescriptor Method issue. I'm about to go learn VB just to finish up my project!!! I'm trying to write a script that will list the users and their rights for folders and files on my network. I've used the WMI getobject function to gather all sorts of info successfully.. but I cannot seem to parse the security descriptors from NTFS. Is there a way in Kixtart to do this???
Sample code (Keep in mind that this is just for testing to try to get this to work!!!):
Dim $ACE[] Dim $Owner[] Dim $Ret[]
$objWMIService = "winmgmts:{impersonationLevel=impersonate}!\\MD50WPJM\root\cimv2:Win32_LogicalFileSecuritySetting.Path='C:\\images'" $colItems = GetObject($objWMIService) ;the following two lines are just diagnostics to see if I can get values from the object ? "Diag1: "+ $colitems.controlflags ? "Diag2: "+ $colitems.path
;attempt to get security object
$ret = $colItems.GetSecurityDescriptor("%temp%") $ACE = $ret.DACL $Owner = $ret.owner For Each $objItem in $ACE ;just to see if I can get something!!! ? "Access Mask: " + $objItem.accessmask For Each $trust in $ace.trustee ? "****" ? "Trustee: " + $Trust.accountname ? "Name: " + $Trust.SIDString Next Next
? "###############" ? "Owner Account Name = " + $owner.name ? "Owner SID = " + $owner.SIDString
Any thoughts??? OR does anyone know of a working Kixtart UDF that successfully returns ACLs without using xcacls???
|