0

I created a batch logon script that checks and removes old versions of a specific piece of software and installs the newest version. Both the install and uninstall process use an .EXE file. The script works great if the user is an administrator, but because logon scripts are run with user permissions, it fails with a normal end-user account.

What is the best way to have the logon script run as an administrator?

1
  • There's a product called PowerBroker that I've used in the past with logon scripts. We already owned the product, though. It might be overkill for your particular use. Commented May 3, 2016 at 17:59

2 Answers 2

4

This is a poor use case for login scripts. A startup script or a scheduled task can both easily run as the SYSTEM account take care of your software installation.

Generally I suggest using some kind of deployment system - SCCM, Patch Manager, Puppet, etc - but there is a quick and dirty solution available if you have a 2008+ domain.

Basically it is scheduled task deployed as a group policy preference. This can be run under the SYSTEM account to provide admin rights. Combined with item level targeting you can easily install only when your conditions are met.

1
  • 1
    Agreed -- this is the wrong tool for the job. Use of Puppet would be a lot easier (and smarter in the long term).
    – Shyatic
    Commented May 2, 2016 at 19:56
0

Is it necessary to use a logon script? I normaly try to do as much as possible with startup scripts... These run in system context with highest privileges.

2
  • I don't believe a startup script will work for me. Only a small group of end-users in different OUs need this application installed, so I don't want it to run on every PC.
    – iFetus
    Commented May 3, 2016 at 15:42
  • If you know the PCs, create a group, put the computer accounts in and target the GPO with the startup script at that group.
    – Robert R
    Commented May 5, 2016 at 13:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .