[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

LoadUserProfile failed with error code : 1314

Posted on 2006-10-31
6
Medium Priority
?
2,571 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 2000 total points
ID: 17866993
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

656 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