【发布时间】:2011-02-28 09:57:48
【问题描述】:
问题:我想按SID获取本地windows用户:
我找到了这段代码
[ADSI]("WinNT://$Env:Computername/<SID=S-1-5-18>")
我从中推断,我可以在 (VB) .NET 中这样做:
Dim strURL As String = "WinNT://" + strComputerName + "/<SID=" + strSID + ">"
Dim de As DirectoryServices.DirectoryEntry = New DirectoryServices.DirectoryEntry(strURL)
de.Properties("whatever").Value.ToString()
但是,这不起作用。 任何人都知道我如何无需循环所有用户(这需要先从 byte[] 转换为字符串,然后比较 [不区分大小写] 很多字符串,这会使其变慢)。
【问题讨论】:
标签: c# .net vb.net permissions directoryservices