In our old MOM 2005 environment we use Tasks to deploy custom applications.
It worked just fine, also under Server 2008 but since 2008 R2 we have the problem here that these tasks don't "really run" as the action account but as local system.
What I mean is:
I launch a VBScript that launches a Powershell Script that is supposed to write to the eventlog with this Description: "%username% $Environmentvar blahblah"
And what I get in the eventlog is:
"COMPUTERNAME$ blahblah" <- therefore the Environmentvar is null and user seems to be localsystem.
Now the funny thing is, the user that wrote into the eventlog is: The MOM Action Account.
The script mentioned here was just for testing purposes, the real script only relies on global variables that are loaded using Powershell Profiles, but when it runs as local system this profile won't get loaded.
As said, this occurs since Server 2008 R2 and I was wondering if anyone else faced a problem like this.