Link to home
Start Free TrialLog in
Avatar of bozworthy
bozworthyFlag for United States of America

asked on

Call to LogonUser Lib "advapi32.dll" works on one server but not another

I'm deploying a windows service that watches for files.  I need to impersonate an account that has access to a network share and this is working on my local machine and a development server but not the prod server.  I can map drives on both servers using the account in question. Myself, the impersonation account, Admins, and SERVICE are all part of the "Impersonate a client.." security setting.  It looks like the call to advapi32.api is failing with a False return on the prod server (I can't attach to a process on the servers to see why but I've added logging that narrows it to that call).
Differences between dev and prod server:
   Prod:Windows Server 2003 R2 Standard EditionSP2  
   dev: Windows Server 2003 Standard Edition SP1  
   Different domains but both my id and the impersonation id can be located and given privileges on both servers using "domain\id" where domain is the same for both.

Any ideas why it's failing?
ASKER CERTIFIED SOLUTION
Avatar of PaulHews
PaulHews
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bozworthy

ASKER

thanks for the quick response.
still no love with either of those two security settings.  do I need to uninstall, reinstall, and restart the service to pick up those changes (I would think not) ?

I don't have GetLastDLLError  implemented in the code at this time but I'll get to work on that.
You will have to restart the service at least I think.
Ok I went back and removed all the security entries and restarted the service after adding each one at a time.  It's the Allow log on locally that does the trick.  Thanks a million.  I think that was quickest solution I've had yet.
Glad you got it working.  Thanks.