1
我正在使用System.DirectoryServices.AccountManagement來管理我的登錄用戶帳戶。C# - 在活動目錄中查找直接報告
我能夠獲取登錄用戶的信息,但無法根據經理獲取直接報告用戶標識。
var context = new PrincipalContext(ContextType.Domain);
var principal = UserPrincipal.FindByIdentity(context, User.Identity.Name);
我有參考此鏈接:C# - Look up a users manager in active directory
但仍然沒有得到任何線索。任何人都可以幫助我呢?