gpt4 book ai didi

.net - System.Security.Principal.NTAccount.Translate() 如何将指定用户解析为 SID

转载 作者:行者123 更新时间:2023-12-04 21:53:52 29 4
gpt4 key购买 nike

我想知道,如果存在具有指定帐户名的本地用户帐户,它会在具有相同名称的任何域帐户之前或之后得到解析吗?

最佳答案

SID解析在调用Translate方法时完成,

http://msdn.microsoft.com/en-us/library/system.security.principal.ntaccount.translate.aspx .

如果你使用NTAccount(string)初始化实例,并提供一个独立的名字(不带域的名字),那么解析由SID查找代码决定(如果你知道如何反编译) 调用 LsaLookupName2,

http://msdn.microsoft.com/en-us/library/windows/desktop/ms721798(v=vs.85).aspx

To translate isolated names

1.If the name is a well-known name, such as Local or Interactive, the function returns the corresponding well-known security identifier(SID).

2.If the name is the name of the built-in domain, the function returns the SID of that domain.

3.If the name is the name of the account domain, the function returns the SID of that domain.

4.If the name is the name of the primary domain, the function returns the SID of that domain.

5.If the name is one of the names of the trusted domain, the function returns the SID of that domain.

6.If the name is a user, group, or local group account in the built-in domain, the function returns the SID of that account.

7.If the name is a user, group, or local group account in the account domain on the local system, the function returns the SID of thataccount.

8.If the name is a user, group, or a local group in the primary domain, the function returns the SID of that account.

9.After looking in the primary domain, the function looks in each of the primary domain's trusted domains.

10.Otherwise, the name is not translated.

关于.net - System.Security.Principal.NTAccount.Translate() 如何将指定用户解析为 SID,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18326214/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com