Using C#, how do you check if a computer account is disabled in active directory?

后端 未结 8 902
暖寄归人
暖寄归人 2020-12-16 17:24

How do you check if a computer account is disabled in Active Directory using C#/.NET

8条回答
  •  没有蜡笔的小新
    2020-12-16 18:07

    If you are using samAcountName or any other Identity field.. it is way simpler to use UserPrincipal.FindByIdentity method. And use the hybrid approach to Leandro López and Deepti. both their approaches are very good.. but very narrowly focused. More details on this flag is available on MSDN

提交回复
热议问题