We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

craigl
Posts: 2
Joined: Mon May 13, 2013 3:12 am

Schedule Task with created user

Hi, I'm trying to use the Enterprise version of Advanced Installer to both create a user account and then use that user account as the account for a scheduled task.

Whenever I do this, I'm getting an error 0x80070569, which seems to imply that the user doesn't have permission for a specific login type. I'm assuming this is because it hasn't been granted the SeBatchLogonRight right.

I cannot see how to accomplish this in the Advanced Installer UI, is there a way? I'm using the evaluation v10 to do this with.

Thanks,

CraigL
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Schedule Task with created user

Hello,

You can achieve that if you create a separate installation project that will create your user account. Then you can add the above package as a pre-install prerequisite to your main installation project and also add (in the main project) a scheduled task for the user account created by the prerequisite package.

Let us know if this helps, otherwise please give us more details about your scenario.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
craigl
Posts: 2
Joined: Mon May 13, 2013 3:12 am

Re: Schedule Task with created user

So it has to be two completely separate install packages?

Why will creating the Scheduled Task in a second install configure the necessary security policies, but doing them both in one package not?

I'm not sure what more details I can provide. I have a basic install, containing the EXE that I want to create a scheduled task for. I have two steps in my Advanced Installer package, one to create a user account, and one to create the scheduled task. It seems to work, as the scheduled task is created and is configured to run as the user that is created. It seems to try and start, logs in successfully, but gets the error listed below indicating that the account that was created doesn't have the requested login type right. If I understand the documentation I'm reading, it's the SeBatchLogonRight that is required.

Any more info I can provide?

CraigL
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Schedule Task with created user

Hello,

First of all I apologize because I misunderstood your question. I'm afraid we don't have predefined support for setting the "SeBatchLogonRight" policy for a specific user account. However, in order to achieve what you want you can try to create a custom action which will set the "SeBatchLogonRight" policy for the created user account. The custom action should be scheduled after "Install Execution Stage -> Add Resources" action group and should run as deferred with no impersonation.

For example, you can create your custom action as a custom action written in C# or a custom action written in C++.

Also, you can add the created user account (from our "Users and Groups" page) to Administrator group (in the "Member Of" section from "User Account Properties" right pane) and see if the behavior still persist.

Here are the steps to proceed:
- add your user account in "Users and Groups" page
- add the schedule task in "Schedule Tasks" page
- go to "Custom Actions" page and add a custom action which will set the "SeBatchLogonRight" policy for the created user account

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”