electriclesno.blogg.se

Net user administrator access denied
Net user administrator access denied








net user administrator access denied net user administrator access denied

Minor point of interest - in my original post I said that even when I made the ASPNET user an administrator it still couldn't create users. Not used and the ASP.NET security context (ASPNET user on Win XP) is used instead. The problem in a nutshell is that, even though a username & pwd are specified in the PrincipalContext to connect to the local machine's security store with, and that user is an administrator, they are What exactly is wrong with my machine I don't know. At least when I ran the same code on another XP machine and on a Win 2003 server it workedįine. It seems there is something "wrong" with my Windows XP dev machine. I really want to be able to specify a u/n & pwd in code and not have to configure the accounts the web app runs under.Īfter weeks of frustration I finally found out that there was nothing wrong with my original code. This tells me that the u/n & pwd specified in the PrincipalContextĬreation are not used as the security context for my function. However when running the app as an administrator the function worked. I got the same error when running the app as a regular user. I also tried creating a Console app running the same function. PrincipalContext context = new PrincipalContext(ContextType.Machine, PrimaryWindowsServer, null, "HostUser", "HostPassword") Just in case I tried setting the Container parameter to Null in the PrincipalContext creation but it made no difference. In my case I am creating an account on the local machine and the MS documentation says that in that caseĬontainer should be Null. It talks about specifying the right container, but that applies only to creating accounts in Active Directory. LDAP in c# General access denied error PrincipalContext LogEntry("CreateUser", username + " already exists") UserPrincipal up = UserPrincipal.FindByIdentity(context, IdentityType.SamAccountName, username) PrincipalContext context = new PrincipalContext(ContextType.Machine, PrimaryWindowsServer, "HostUser", "HostPassword") public void CreateUserAccount(string username, string password) I can't use Impersonation in the web.config for I have tried specifying an administrator u/n & pwd in the PrincipalContext. I have tried putting my ASPNET account in the Administrators group. NetCred credentials, AuthenticationTypes authTypes, Boolean needToSetPassword) at .Insert(Principal p) at .Save() P, StoreCtx storeCtx, GroupMembershipUpdater updateGroupMembership, NetCred credentials, AuthenticationTypes authTypes) at .InsertPrincipal(Principal p, StoreCtx storeCtx, GroupMembershipUpdater updateGroupMembership, General access denied error -> System.UnauthorizedAccessException: General access denied error at .IAds.SetInfo() at () at .Appl圜hangesToDirectory(Principal I get the following error every time I call Save on the new UserPrinciple object: I have a function to create a local user in the web server that my.










Net user administrator access denied