Solved

LoadUserProfile failed with error code : 1314

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

758 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now