This free GUI tool lets you quickly see who is a member of the local Administrators group on multiple remote computers.
This was originally a command line program, but I’ve now re-written it from scratch as a GUI so it is much easier to use and has a lot more options. You can download it for free here: Get Local Admins GUI
I tried your code for folder permisson on http://www.vbforums.com/showthread.php?p=3810879#post3810879, and works well, but when I tried to adapt to a file, gave me error:
Error 1: Value of type ‘System.Security.AccessControl.DirectorySecurity’ cannot be converted to ‘System.Security.AccessControl.FileSecurity’.
The code I use is:
———————————————————-
Imports System.Security.AccessControl
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim FilePath As String = “C:\test,txt”
Dim UserAccount As String = “Everyone”
Dim FileInfo As IO.FileInfo = New IO.FileInfo(FilePath)
Dim FileAcl As New DirectorySecurity
FileAcl.AddAccessRule(New FileSystemAccessRule(UserAccount, FileSystemRights.Modify, InheritanceFlags.ContainerInherit Or InheritanceFlags.ObjectInherit, PropagationFlags.None, AccessControlType.Deny))
‘FolderAcl.SetAccessRuleProtection(True, False) ‘uncomment to remove existing permissions
FileInfo.SetAccessControl(FileAcl)
End Sub
End Class
———————————————————–
The “FileAcl” from the last line seems to be the problem ” FileInfo.SetAccessControl(FileAcl)”
Can you help me with that?
10x
I replied to your post on vbforums – you just need to declare your FileACL object as FileSecurity instead of DirectorySecurity (just like the error message tells you).
We are not able to select multiple computer from the target list once imported from AD. There should be some way to selected multiple computer so that it can be removed.
Thanks for the suggestion, I will add this to the next update.
Thanks
Chris