Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Answer Access Is Denied in WTSQueryUserToken and Windows 2003 Ent SP1

Hello,
I have a service that needs to get the current user's token. I do this by using the HandlerEx along with the WTS notifications that occur during any Logon/Logoff/Lock/etc.. to get the SessionId and call WTSQueryUserToken with that SessionId. This code works fine on the XP Sp1 and Sp2 operating systems, but for some reason, whenever I call it with Windows 2003 enterprise SP1, the code fails to run, returning an error of Access Is Denied.

I looked it up and saw that Access Is Denied means that I either don't have the Local System user or the SE_TCB_NAME privilege enabled. I have both of them enabled, and it still doesn't work. If it helps, I've noticed that the session ID is 0.

I'm really lost, can anyone please help?
Thanks
Sign In or Register to comment.