Logonuser Error Codes
Contents |
Studio 2015 products Visual Studio Team Services Visual Studio Code Visual Studio Dev Essentials Office Office Word/Excel/PowerPoint Microsoft Graph Outlook OneDrive/Sharepoint Skype windows error codes list Services Store Cortana Bing Application Insights Languages & platforms Xamarin ASP.NET windows error codes lookup C++ TypeScript .NET - VB, C#, F# Server Windows Server SQL Server BizTalk Server SharePoint Dynamics windows error codes 0x Programs & communities Students Startups Forums MSDN Subscriber downloads Sign in Search Microsoft Search Windows Dev Center Windows Dev Center Explore Why Windows What’s new for Windows
Logonuser Example C++
10 Intro to Universal Windows Platform Dev Center Benefits Develop for accessibility Build for enterprise Docs Windows apps Get started Design and UI Develop API reference Publish Monetize Promote Games Get started UI design Develop Publish Desktop Get started Design Develop API reference Test and deploy Compatibility Windows IoT Microsoft Edge Windows Holographic Downloads Samples windows error codes and solutions pdf Support Dashboard Explore Why Windows What’s new for Windows 10 Intro to Universal Windows Platform Dev Center Benefits Develop for accessibility Build for enterprise Docs Windows apps Get started Design and UI Develop API reference Publish Monetize Promote Games Get started UI design Develop Publish Desktop Get started Design Develop API reference Test and deploy Compatibility Windows IoT Microsoft Edge Windows Holographic Downloads Samples Support Dashboard Error Handling Error Handling Reference System Error Codes System Error Codes System Error Codes (1300-1699) System Error Codes (1300-1699) System Error Codes (1300-1699) System Error Codes (0-499) System Error Codes (500-999) System Error Codes (1000-1299) System Error Codes (1300-1699) System Error Codes (1700-3999) System Error Codes (4000-5999) System Error Codes (6000-8199) System Error Codes (8200-8999) System Error Codes (9000-11999) System Error Codes (12000-15999) TOC Collapse the table of content Expand the table of content This documentation is archived and is not being maintained. This documentation is archived and is not being maintained. System Error Codes (1300-1699) Note Â
360 games PC games windows blue screen error codes Windows games Windows phone games Entertainment All Entertainment
Logon32_logon_batch
Movies & TV Music Business & Education Business Students & educators
Logon32_logon_interactive
Developers Sale Sale Find a store Gift cards Products Software & services Windows Office Free downloads & security Internet https://msdn.microsoft.com/en-us/library/windows/desktop/ms681385(v=vs.85).aspx Explorer Microsoft Edge Skype OneNote OneDrive Microsoft Health MSN Bing Microsoft Groove Microsoft Movies & TV Devices & Xbox All Microsoft devices Microsoft Surface All Windows PCs & tablets PC accessories Xbox & games Microsoft Lumia All https://support.microsoft.com/en-us/kb/2508225 Windows phones Microsoft HoloLens For business Cloud Platform Microsoft Azure Microsoft Dynamics Windows for business Office for business Skype for business Surface for business Enterprise solutions Small business solutions Find a solutions provider Volume Licensing For developers & IT pros Develop Windows apps Microsoft Azure MSDN TechNet Visual Studio For students & educators Office for students OneNote in classroom Shop PCs & tablets perfect for students Microsoft in Education Support Sign in Cart Cart Javascript is disabled Please enable javascript and refresh the page Cookies are disabled Please enable cookies and refresh the page CV: {{ getCv() }} English (United States) Terms of use Privacy & cookies Trademarks © 2016 Microsoft
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this http://stackoverflow.com/questions/7488786/why-doesnt-logonuser-work-for-domain-accounts site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x http://stackoverflow.com/questions/5023607/how-to-use-logonuser-properly-to-impersonate-domain-user-from-workgroup-client Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Why doesn't error codes LogonUser(…) work for domain accounts? up vote 6 down vote favorite 6 I've been trying to use LogonUser(...) to get an access token for a user account, as in this MSDN sample. // Call LogonUser to obtain a handle to an access token. bool returnValue = LogonUser(userName, domainName, Console.ReadLine(), LOGON32_LOGON_INTERACTIVE, LOGON32_PROVIDER_DEFAULT, out safeTokenHandle); When I run the sample (with Administrator privileges) it works fine windows error codes when given a domain of . and a local user account name and password, but no matter what I do I get error code 1326 (Logon failure: unknown user name or bad password) if I try to use a domain account. I get the same result if I enter garbage for the domain, which makes me wonder if it's actually contacting the DC at all. What could be stopping this from working? windows security winapi active-directory impersonation share|improve this question edited Sep 20 '11 at 18:07 asked Sep 20 '11 at 16:53 GraemeF 7,42443366 1 That could be due to a bunch of things unfortunately. Is the machine connected to the domain? Is the domain user allowed to log onto that machine? Are DNS settings configured correctly? (I did see a Citrix article that suggested that this could be an issue.). The following article has some info on what is happening when you enter garbage for the domain - groups.google.com/group/… –Brian Lyttle Sep 20 '11 at 17:02 Have you validated that this works without the Console.ReadLine() call (e.g. supplying a password as a string directly)? –Brian De
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up How to use LogonUser properly to impersonate domain user from workgroup client up vote 28 down vote favorite 13 ASP.NET: Impersonate against a domain on VMWare This question is what I am asking, but the answer does not provide details on how the _token is derived. It seems to only use WindowsIdentity.GetCurrent().Token so there's no impersonation happening. Can I impersonate a user on a different Active Directory domain in .NET? This next question has conflicting answers, with the accepted one bearing a comment "I'm beginning to suspect that my problem lies elsewhere." Not helpful. LogonUser works only for my domain This next question seems to imply it is not possible, but it deals with 2 domains so I am not sure if it is relevant. My real question is: Is it possible? And if so, How? or Where did I go wrong? What I have tried so far is, using the code from http://msdn.microsoft.com/en-us/library/chf6fbt4%28v=VS.80%29.aspx bool returnValue = LogonUser(user, domain, password, LOGON32_LOGON_NETWORK, LOGON32_PROVIDER_DEFAULT, ref tokenHandle); // after this point, returnValue = false The Win32 error is Logon failure: unknown user name or bad password c# .net winforms c#-2.0 impersonation share|improve this question asked Feb 16 '11 at 23:48 RichardTheKiwi 71.6k16107175 add a comment| 5 Answers 5 active oldest votes up vote 38 down vote Very few posts suggest using LOGON_TYPE_NEW_CREDENTIALS instead of LOGON_TYPE_NETWORK or LOGON_TYPE_INTERACTIVE. I had an impersonation issue with one machine connected to a domain and one not, and this fixed it. The last code snippet in this post suggests that impersonating across a forest does work, but it doesn't specifically say anything about trust being set up. So this may be worth trying: const int LOGON_TYPE_NEW_CREDENTIALS = 9; const int LOGON32_PROVIDER_WINNT50 = 3; bool returnValue = LogonUser(user, domain, password, LOGON_TYPE_NEW_CREDENTIALS, LOGON32_PROVIDER_WINNT50, ref tokenHandle); MSDN says that LOGON_TYPE_NEW_CREDENTIALS