Product: PowerShell Universal
Version: 1.5.19
IIS, LocalSystem AppPool
Guys, I’m out of ideas here. Decided to finally try out PowerShell Automation, but having weird issues
Issue #1:
This was on v1.5.8
Scheduled tasks were way off. For example I set 2 triggers at 7:30 AM and 6:30PM, but they ran like around seemingly random times lol.
After checking changelog I noticed there was potentially a fix for this? I have since upgraded to v1.5.19 and will report back if this is still an issue
Issue #2:
Getting these in event logs. Related to issue #1 and the scheduler bug in another topic I found?
Failed to schedule job. CRON expression is invalid. Please see the inner exception for details. (Parameter ‘cronExpression’) Wrong number of parts in the
0 30 18 ? * MON-FRI *
cron expression, you can only use 5 or 6 (with seconds) part-based expressions.
Issue #3:
I have no problems impersonating service accounts (domain user) from Universal Dashboard and it works great.
However same service account and same exact code will NOT run on PSU Automation using RunAs account unless I add this service user as local Administrator. So it definitely smells like permission/policy problem on my IIS/PSU server.
Script is basic on-prem exchange session that is used with invoke-command
$session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://exchange/PowerShell/ -Authentication Kerberos
$ruleExists = Invoke-Command -ScriptBlock { Get-TransportRule “Disclaimer: xxx” } -Session $session
Service user is added to following policies at “Local Policies > User Rights Assignment”:
- Generate security audits
- Adjust memory quotas for aprocess
- Replace a process level token
- Log on as a service
- Log on as a batch job
- Impersonate a client after authentication
I also tried “Allow log on automatically”, “Access this computer from the network”, “obtain an impersonation token from another user…”, etc policies, but nothing worked.
However as soon as I add this service user as local Admin, script works ok.
Thoughts?
Kind regards,
Ray