Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am using LogonUser function to logon an account to Windows 2008 R2 server on a domain with clusterring.

When using LOGON32_LOGON_INTERACTIVE as LogonType, I successfully login.

When using LOGON32_LOGON_SERVICE as LogonType, Login fails, EventViewer says:

An account failed to log on. Logon Type: 5

Account For Which Logon Failed:

Security ID:        NULL SID
Account Name:       thename
Account Domain:     thedomain
Logon ID: 0x1009371c Logon Type: 5

Failure Information:
Failure Reason:     The user has not been granted the requested logon type at this machine.
Status:         0xc000015b
Sub Status:     0x0

Was not sure if its for superuser or stackoverflow (calling LogonUser from C# code), but I guess its some Windows server issue*.

EventID = 4625

Edit: Found that - 0xc000015b The user has not been granted the requested logon type (aka logon right) at this machine

Edit: Should be serverfault question...

share|improve this question

migrated from superuser.com Nov 13 '12 at 9:33

This question came from our site for computer enthusiasts and power users.

1 Answer 1

up vote 1 down vote accepted

Ok, after deep research found that in the Local Security Policy, under User Right Assignment

"Log on as a service" should be granted to users logging in with LOGON32_LOGON_SERVICE logon type.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.