Jump to content

Recommended Posts

Posted

I've had a powershell scheduled task running without issues on server 2016 with the option selected 'run whether user logged on or not'

The server has been clean installed with server 2019, and imported the scheduled task initially., however I have re-made the task from scratch.

Now the issue is that when 'run when only user is logged in' I can right click the task and it runs ok.

However,when the server is logged off, the task doesnt run.

Can any assist please what may have changed between OS versions?

Thanks.

Posted

If I am reading this correctly, then you have set the task to ONLY RUN when a user is logged on?

 

The task will run when you manually start it because a user is logged on. If the server is logged off there is nobody logged on and the task will not run.

 

Your previously working task is set to run whether a user is logged on or not.

Posted
If I am reading this correctly, then you have set the task to ONLY RUN when a user is logged on?

 

The task will run when you manually start it because a user is logged on. If the server is logged off there is nobody logged on and the task will not run.

 

Your previously working task is set to run whether a user is logged on or not.

Yes that is all correct. Thanks.

Posted
Now the issue is that when 'run when only user is logged in' I can right click the task and it runs ok.

 

However, when the server is logged off, the task doesnt run.

 

As above, I don't think you can have a task set to run 'only when a user is logged in' and then expect it to run when it's 'logged off'...

 

I remember when I first started I used to leave the server logged in and just locked as I was worried things wouldn't run when I was logged off!

Posted
As above, I don't think you can have a task set to run 'only when a user is logged in' and then expect it to run when it's 'logged off'...

 

I remember when I first started I used to leave the server logged in and just locked as I was worried things wouldn't run when I was logged off!

 

Sorry just to clarify:

 

If i set it to 'run whether user is logged on or not' it doesnt run when the server is logged off.

If set to 'run when user is logged on' and leave the server logged in, it will run.

 

I'd rather not leave the server logged in and locked from a security aspect. thanks.

Posted
As above, I don't think you can have a task set to run 'only when a user is logged in' and then expect it to run when it's 'logged off'...

 

 

 

I remember when I first started I used to leave the server logged in and just locked as I was worried things wouldn't run when I was logged off!

 

 

Sorry just to clarify:

 

If i set it to 'run whether user is logged on or not' it doesnt run when the server is logged off.

If set to 'run when user is logged on' and leave the server logged in, it will run.

 

I'd rather not leave the server logged in and locked from a security aspect. thanks.

Posted

Not sure exactly why you're encountering the problems, but this might this be a situation where a Managed Service Account would be worth trying.

 

Your problem might be dependant on the nature of the account that you're using. If it's got local admin privileges, Server 2019 may be getting in the way of how you're trying to use it (something to do with Admin Approval Mode?). I know that local admins in 2019 don't have the sort god-level privileges over all drives and files that one might expect, for instance. Never used 2016 so I can't suggest what might have changed for you after the upgrade to 2019.

Posted

Which user is it running under, do you have the 'Do Not Store Password' option ticked (and does the task even have to run as a 'user', I have this task set to 'SYSTEM')?

 

task.jpg

Posted
Not sure exactly why you're encountering the problems, but this might this be a situation where a Managed Service Account would be worth trying.

 

Your problem might be dependant on the nature of the account that you're using. If it's got local admin privileges, Server 2019 may be getting in the way of how you're trying to use it (something to do with Admin Approval Mode?). I know that local admins in 2019 don't have the sort god-level privileges over all drives and files that one might expect, for instance. Never used 2016 so I can't suggest what might have changed for you after the upgrade to 2019.

 

I'm still a bit miffed by something like this in Windows 10!

 

I always forget when I go to do something in 'Settings' whilst signed on as admin and it tells me I don't have 'sufficient privileges'... however if I find the equivalent item in 'Control Panel' or even search for the actual file and run it... no problem! :doh:

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...