Convert a username to a SID string in C#/.NET

前端 未结 3 534
半阙折子戏
半阙折子戏 2020-11-30 21:23

There\'s a question about converting from a SID to an account name; there isn\'t one for the other way around.

How do you convert a username to a SID string, for exa

3条回答
  •  广开言路
    2020-11-30 22:07

    The LookupAccountName() native method has the advantage of being able to be executed on a remote machine whereas the .NET methods can't be executed remotely.

    Though the example doesn't show it LookupAccountName(null) <- this is the remote system to execute on.

提交回复
热议问题