Oprette windows bruger
Jeg prøver at oprette en windows bruger via nedenstående kode:DirectoryEntry AD = new DirectoryEntry("WinNT://" + Environment.MachineName + ",computer");
DirectoryEntry NewUser = AD.Children.Add("AAAnetmover", "user");
NewUser.Invoke("SetPassword", new object[] {"123456"});
NewUser.Invoke("Put", new object[] {"Description", "test"});
NewUser.CommitChanges();
Men den giver mig flg. fejl:
General adgang nægtet-fejl
ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.
Selv om jeg sætter ASPNET brugeren med adminrettigheder, så hjælper det ikke. Hvad gør jeg galt?
Kræver det at jeg har Active Directory installeret på min XP computer? Hvordan tjekker jeg om jeg har AD installeret?
