在LogonType LOGON32_LOGON_SERVICE上使用LogonUser在Windows 2008服务器中login用户失败

我正在使用LogonUser函数将帐户login到具有群集环境的域上的Windows 2008 R2服务器。

当使用LOGON32_LOGON_INTERACTIVE作为LogonType时,我成功login。

当使用LOGON32_LOGON_SERVICE作为LogonType时,login失败,EventViewer说:

帐户login失败。 logintypes:5

帐户哪个login失败:

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 

不知道如果它的超级用户或stackoverflow(从C#代码调用LogonUser),但我猜它的一些Windows服务器问题*。

EventID = 4625

编辑:发现 – 0xc000015b用户没有被授予请求的logintypes(又名login权限)在这台机器

编辑:应该是serverfault问题…

好的,经过深入研究发现,在本地安全策略下,用户权限分配

应以LOGON32_LOGON_SERVICElogintypeslogin的用户授予“作为服务login”。