I have a code for create user in active directory using LDAP , and also set them password, but this code only work in servers which on their own have active directory. we have a web server in which my webforms there. this server doesn't have active directory and is a child of the main domain. I mean we have a tree domain that the main domain for instance is test.com and other servers like webserver is child domain of that server. I could change password in the main server which has active directory but when I use my code which work properly on other domain which ownselves has active directory, I recieve this error message : login failure: unknown username or bad password . I made a user in main active directory and this user is the member of account operator (that could make and set password for domain users) please help me and guide me what should I do that my code work in main domain server too. P.S. I did everything same as other servers which has their own active directory , it works properly on them with the user which is the member of account operator but not work in that server. I am in a hurry please help me and guide me fast. by the way, I couldn't set the IWAN as account operator because it is unsafe, show me other way please