I am working in WinXP 64-bit, Visual Studio 2008 Test Edition. I have written a unit test in C# for a method written in VB that calls CreateProcessAsUser after impersonating a domain user.
Initially I was working only on my workstation when I was getting the privilege error. I then granted the domain user the rights to 'Replace a process level token' and 'Adjust memory quotas for a process'. This fixed the problem but only on my machine. When the unit test is run on a build server either locally through Visual Studio or during continuous integration builds, it still fails. I granted the same rights to the domain user on the build server with no success.
I've traced through the code and impersonation is working, with a valid impersonated token being returned. The domain user has full access to the application and the working directory. The application is merely a small batch file that will execute through cmd.exe.
As mentioned, everything works as intended on my workstation so it isn't the unit test. The error indicates that this domain user is missing something on the build server but I even granted rights it shouldn't have just to see if I could get it to work but no luck.
The build server is running MS WIndows Server 2003 Standard x64 Edition.
Any ideas would be appreciated.