如何获得用户ID Active Directory?

首先,我甚至不知道

"用户登录"

这是这里的右词。

上下文是我使用 VisualSVN Server 驾驶 / 管理我的存储库中的访问权限 SVN 具有身份验证 Windows, 和

authz-windows

它创建的文件包含字符串长度 45 符号而不是 "监督" 用户名或组。

我需要手动编辑此文件,因为我发现与特定用户或组相关的魔术字符串?
已邀请:

涵秋

赞同来自:



authz-windows

该文件将用户安全标识符和组进行比较 Active Directory (

objectSid

场地 LDAP).

但请注意,此字段的值 AD 存储为十六进制,所以你可以使用
https://serverfault.com/questi ... g-sid
确定相关的用户标识符。

(
https://stackoverflow.com/a/9321291/895996
在 StackOverflow.)

君笑尘

赞同来自:

更新 2016:

按照更新到最新版本。 VisualSVN Server. 以。。。开始 VisualSVN Server 3.4, 服务器附带了许多cmdlet PowerShell. 他们中的一些人喜欢
https://www.visualsvn.com/supp ... sRule
可以显示分配给用户帐户和组的访问规则列表 Active Directory / Windows.

以下是在CSV文件中创建访问报告的示例 AccessReport.csv:


Get-SvnAccessRule | Select Repository, Path, AccountName, Access | Export-Csv -NoTypeInformation AccessReport.csv

关于凯尔特的完整信息 PowerShell 为了 VisualSVN Server 看文章
https://www.visualsvn.com/support/topic/00088/
.

过时的答案:

我同意答案

宿醉

我希望你找到以下内容 VBScript 有用。 它创建了一个特定权限的列表并正确转换

SID

有意义和可读

领域 \ 用户名

.

'
' Print permissions in the form: user_name,path,level
'
strComputer = "."
Set wmi = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\VisualSVN")

Set win = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")

' Return text representation for the Access Level
Function AccessLevelToText(level)
If level = 0 Then
AccessLevelToText = "No Access"
ElseIf level = 1 Then
AccessLevelToText = "Read Only"
ElseIf level = 2 Then
AccessLevelToText = "Read/Write"
Else
AccessLevelToText = "Unknown"
End If
End Function

' Return repository path for the object
Function GetPath(obj)
cname = assoc.Path_.Class
If cname = "VisualSVN_Service" Then
GetPath = "Repositories Root"
ElseIf cname = "VisualSVN_Repository" Then
GetPath = assoc.Name
ElseIf cname = "VisualSVN_RepositoryEntry" Then
GetPath = assoc.RepositoryName & ": " & assoc.Path
Else
GetPath = "Unknown"
End If
End Function

' Convert SID to user name
Function SidToUserName(sid)
Set account = win.Get("Win32_SID.SID='" & sid & "'")
user = account.AccountName
domain = account.ReferencedDomainName
SidToUserName = domain & "\" & user
End Function

' Return user name associated with account
Function GetAccountName(account)
If account.Path_.Class = "VisualSVN_WindowsAccount" Then
GetAccountName = SidToUserName(account.SID)
Else
GetAccountName = account.Name
End If
End Function

' Iterate over all security descriptions
Set objs = wmi.ExecQuery("SELECT * FROM VisualSVN_SecurityDescriptor")
For Each obj In objs
Set assoc = wmi.Get(obj.AssociatedObject)

For Each perm in obj.Permissions
name = GetAccountName(perm.Account)
level = AccessLevelToText(perm.AccessLevel)

Wscript.Echo name & "," & GetPath(assoc) & "," & level
Next
Next

要回复问题请先登录注册