0

I'm using VisualSVN server 2.5.8 and enabled windows authentication.

I need to write a vbscript to use WMI query to export Access rights of the all repositories for the users to excel format.

I'm new to the vbscript and WMI.

Any sample vbscript is there to export the Access rights?

thanks

user1553605
  • 1,333
  • 5
  • 24
  • 42

1 Answers1

0

According to this thread on svnforum.org something like this should work:

Set svn = GetObject("winmgmts://./root/VisualSVN")
Set wmi = GetObject("winmgmts://./root/cimv2")

Set accessLevel = CreateObject("Scripting.Dictionary")
accessLevel.Add 0, "No Access"
accessLevel.Add 1, "Read Only"
accessLevel.Add 2, "Read/Write"

For Each sd In svn.ExecQuery("SELECT * FROM VisualSVN_SecurityDescriptor")
  For Each perm in sd.Permissions
    Set account = wmi.Get("Win32_SID.SID='" & perm.Account.SID & "'")
    WScript.Echo sd.AssociatedObject & ": " _
      & account.AccountName & "\" & account.ReferencedDomainName & " " _
      & accessLevel(perm.AccessLevel)
  Next
Next
Ansgar Wiechers
  • 193,178
  • 25
  • 254
  • 328