Server is unwilling to process the request - Active Directory - Add User via C#

后端 未结 6 1577
陌清茗
陌清茗 2020-12-18 23:33

I used the example in this page to add a user to an Active Directory group, but I get an exception with the message \"Server is unwilling to process the request\" when execu

6条回答
  •  北海茫月
    2020-12-19 00:11

    ldapwiki.com describes potential causes for "The server is unwilling to process the request". Check ExtendedErrorMessage property of your exception to figure out what applies. In my case "00002145: SvcErr: DSID-031A1254, problem 5003 (WILL_NOT_PERFORM)". The following line resolved the issue:

    ent.Properties["groupType"].Value = 8;
    

    I had missed to set groupType and so attempted to nest a universal group in a global group. Find more information on groupType attribute in ldapwiki.com

提交回复
热议问题