How are you running the code with alternate credentials? (GPO,Runas,Runnas,Sunar, etc)