Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
When running an execute resource as an alternate user in Windows (chef local-mode), the environment isn't updated to reflect the alternate user's profile #7690
When running an execute resource as an alternate user the environment (eg. USERNAME, USERPROFILE, USER, APPDATA, etc) remains the same as the user who originally executed the chef-client rather than the user specified in the execute resource. I've assigned the SeAssignPrimaryTokenPrivilege to the user executing the script and this doesn't seem to make a difference.
There's a chance that because I'm running this as part of a domain-joined PC, that there's some other group-policy-related stuff happening here to screw things up...
Windows 7 x64
We output the log to a text file because otherwise the output is hidden (due to resource being sensitive)
I haven't replicated the file output as part of this step; suffice to say that this output file is pretty much identical to running the same command below directly as the user running the chef-client.