Solved

LoadUserProfile failed with error code : 1314

Posted on 2006-10-31
6
2,514 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
[X]
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
  • 2
6 Comments
 

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
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…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

695 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