Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

LoadUserProfile failed with error code : 1314

Posted on 2006-10-31
6
2,464 Views
Last Modified: 2012-05-05
i have used all this function:
const int LOGON32_PROVIDER_DEFAULT = 0;
const int LOGON32_LOGON_INTERACTIVE = 2;
(1)bool returnValue = LogonUser(userName, domainName, password, LOGON32_LOGON_INTERACTIVE, LOGON32_PROVIDER_DEFAULT,      ref tokenHandle);
ImpersonationXP.PROFILEINFO  profile = new ImpersonationXP.PROFILEINFO();
profile.dwSize  = 32;
profile.lpUserName = WindowsIdentity.GetCurrent().Name;
(2)bool retLoadProfile = LoadUserProfile(tokenHandle, ref profile);
                  string Application = Environment.GetEnvironmentVariable(@"D:\ImpersonationXP\ImpersonationXP\bin\Debug");
                  string  CommandLine = @"Setup.Exe";
                  const uint NORMAL_PRIORITY_CLASS = 0x0020;
                  PROCESS_INFORMATION pInfo = new PROCESS_INFORMATION();
                  STARTUPINFO sInfo = new STARTUPINFO();
                  SECURITY_ATTRIBUTES pSec = new SECURITY_ATTRIBUTES();
                  SECURITY_ATTRIBUTES tSec = new SECURITY_ATTRIBUTES();
                  pSec.nLength = Marshal.SizeOf(pSec);
                  tSec.nLength = Marshal.SizeOf(tSec);
(3) bool retCreateProcess = CreateProcessAsUser(tokenHandle,null,CommandLine,ref pSec,ref tSec,false,NORMAL_PRIORITY_CLASS,IntPtr.Zero,null,ref sInfo,out pInfo);

I get this following error
Value of Windows NT token: 1684
LoadUserProfile failed with error code : 1314
Error: [1314] A required privilege is not held by the client.
Exception occurred. Access is denied
Is there any priviligies to SetPrivilege
and security issues
Kindly help me with the code
0
Comment
Question by:sivanand_m
  • 2
6 Comments
 
LVL 2

Expert Comment

by:NewMom2Brandon
ID: 17862405
0
 

Author Comment

by:sivanand_m
ID: 17865658
Hi
Thanks for the link but i am written the code in console application not in web based application
Kindly help me it is becoming a bit urgent.
0
 
LVL 2

Accepted Solution

by:
NewMom2Brandon earned 500 total points
ID: 17866993
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question