Principal accountInfo;            
            using (PrincipalContext ctx = new PrincipalContext(ContextType.Domain, domain))
            {
                accountInfo = Principal.FindByIdentity(ctx, name);
            }

            if (accountInfo == null)
            {
                return false;
            }

       AccountType accountType
if (accountInfo is UserPrincipal) { accountType = AccountType.User; } else if (accountInfo is GroupPrincipal) { accountType = AccountType.Group; } else { accountType = AccountType.Machine; }

  

相关文章:

  • 2021-05-22
  • 2022-12-23
  • 2022-12-23
  • 2022-01-10
  • 2022-02-22
  • 2022-12-23
  • 2022-12-23
  • 2021-05-27
猜你喜欢
  • 2021-12-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-23
  • 2021-08-10
相关资源
相似解决方案