Want to run on local machine as different user but seems that windows has limitations on running as different user on lo
Posted: 18 Nov 2021 04:08
Dear all,
My Objective: run a scheduled task on the local machine as the designed scheduled user, i.e. cambridge in this case
however I'm able to run as myself which is not what I want
cambridge is a local user account. it is not a domain user.
many thanks in advance!
Best Regards
My Objective: run a scheduled task on the local machine as the designed scheduled user, i.e. cambridge in this case
Code: Select all
SCHTASKS /Run /U rman /P cambridge@123 /TN delete_expired_backup /HRESULT
ERROR: Invalid syntax. Cannot specify user name without specifying system name.
Type "SCHTASKS /?" for usage.
SCHTASKS /Run /S system /U rman /P cambridge@123 /TN delete_expired_backup /HRESULT
C:\Users\lhung>SCHTASKS /Run /S system /U rman /P cambridge@123 /TN delete_expired_backup /HRESULT
ERROR: The request is not supported
SCHTASKS /Run /S localhost /U rman /P cambridge@123 /TN delete_expired_backup /HRESULT
ERROR: User credentials are not allowed on the local machine.
Code: Select all
SCHTASKS /Run /TN delete_expired_backup /HRESULT
SUCCESS: Attempted to run the scheduled task "delete_expired_backup_copy"
many thanks in advance!
Best Regards