How I get Active Directory User Properties with System.DirectoryServices.AccountManagement Namespace?

前端 未结 2 726
广开言路
广开言路 2021-02-15 02:52

I want do get Active Directory Properties from a user and I want to use System.DirectoryServices.AccountManagement.

my code:

public static v         


        
2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-15 03:08

    If you want to change the proppertie dont forget to call userPrincipal.save() after you changed the value.

    entry.Properties["company"].value = company;
    userPrincipal.save();
    

提交回复
热议问题