Hmmm post not yet approved. Maybe he is busy. Here it is anyway:
$ShedService = New-Object –comobject "Schedule.Service"
$Task = $ShedService.NewTask(0)
$Task.RegistrationInfo.Description = "UserLogonScript"
$Task.Settings.Enabled = $true
$Task.Settings.AllowDemandStart = $true
$trigger = $task.triggers.Create(9)
$trigger.Enabled = $true
$action = $Task.Actions.Create(0)
$action.Path = "cmd.exe"
$action.Arguments = "/c echo %temp% > c:\temp\out.txt"
$taskFolder = $ShedService.GetFolder("\")
$taskFolder.RegisterTaskDefinition("UserLogonScript", $Task , 6, "Users", $null, 4)
This PS code creates a scheduled task that is triggered on user logon, and it will run in the context of the user that just logged on. You can check the contents of the file c:\temp\out.txt to verify this.