Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xScheduledTask - Missing Only when logged in & Run with elevated rights #107

Closed
dominikheeb opened this issue Oct 20, 2017 · 4 comments
Closed
Assignees
Labels
enhancement The issue is an enhancement request. in progress The issue is being actively worked on by someone.

Comments

@dominikheeb
Copy link

Hi
If I'm not missing anything it seems that i cannot set to run the action with higher privileges and I cannot set Only when User is logged on.

This two are important for a project I work on... would be really nice to have this implemented.

@PlagueHO PlagueHO added enhancement The issue is an enhancement request. help wanted The issue is up for grabs for anyone in the community. labels Oct 26, 2017
@PlagueHO
Copy link
Member

PlagueHO commented Oct 26, 2017

Hi @dominikheeb ,

I can confirm that the Run with Highest Privileges and Run Only when User is Logged On \ Run whether User is Logged on or Not has not been exposed yet in this resource.

I'll see what I can do about getting this exposed before the next release.

For reference these values are found in the Principal object in the ScheduledTask. The LogonType property of the principal needs to be set to Interactive to enable Run Only when User is Logged On. The RunLevel property of the principal must be set to Highest to enable Run with Highest Privileges.

We're currently not assigning a principal object to the task so there is not quite a trivial change. But it isn't major.

@PlagueHO PlagueHO added in progress The issue is being actively worked on by someone. and removed help wanted The issue is up for grabs for anyone in the community. labels Oct 27, 2017
@PlagueHO
Copy link
Member

Hi @dominikheeb - I'm working on this now. Hope to have a dev version complete by the end of the weekend. Thanks.

@PlagueHO
Copy link
Member

PlagueHO commented Nov 4, 2017

Hi @dominikheeb - I've made the changes that I think you need. They're currently in my fork:
https://github.com/PlagueHO/xComputerManagement/tree/Issue-107

Could you possibly give the new version a try and see if it does what you need? I'll then submit the PR if it looks good.

Sorry it took so long, but it turns out there are some behavior differences in New-ScheduledTaskPrincipal in Windows Server 2016 and Windows Server 2012R2 so it took me a while to get everything working correctly.

@PlagueHO
Copy link
Member

I have submitted the PR to add these features, but I'm not sure it will make it into master before next release (next Wednesday I think).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement The issue is an enhancement request. in progress The issue is being actively worked on by someone.
Projects
None yet
Development

No branches or pull requests

2 participants