Solved

LoadUserProfile failed with error code : 1314

Posted on 2006-10-31
6
2,449 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
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…

778 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