2

I'm using a logon batch script to copy some dll files into the c:\windows\system32 folder and register them with the regsrv32 command.

However, both actions fail.

I'm applying the script here: user configuration\policies\scripts (logon/logoff)/logon

The script itself does get executed. However, it just doesn't perform anything that requires admin credentials.

How can I fix this?

3
  • Can your script do what it needs to do on computer startup rather than login?
    – Dan
    Jun 8, 2012 at 17:57
  • This script isn't in the default domain GPO. It's in a GPO assigned to a user group.
    – Force Flow
    Jun 8, 2012 at 17:58
  • @ForceFlow That doesn't matter for what Dan was asking.
    – MDMarra
    Jun 8, 2012 at 17:59

2 Answers 2

5

Using a User Logon Script policy will always run the script as the user. There's no getting around that. As an alternative, you could consider using a Computer Startup Script. These are excecuted as the Local System account, which will have privs roughly equivilent to a local administrator account.

13
  • ok, I added it as a compupter startup script, rebooted the workstation, but the script didn't appear to run at all. The script creates a text file on the desktop when it runs (so that I know when it actually runs)
    – Force Flow
    Jun 8, 2012 at 18:57
  • Did you wait for the group policy refresh interval to pass or run gpupdate /force? Also, is the script in a place where Domain Computers has read access?
    – MDMarra
    Jun 8, 2012 at 19:31
  • Yes, I ran gpupdate /force. Yes, the script is freely accessible by domain computers in mydomain.local\netlogon.
    – Force Flow
    Jun 8, 2012 at 19:37
  • What does gpresult /H tell you? Is the policy being applied? If so, is there anything useful in the event log?
    – MDMarra
    Jun 8, 2012 at 19:54
  • 2
    Right, but again, Startup scripts are Computer settings not user settings. By filtering on a user group you're essentially nullifying the Startup script because it's a computer setting... you can't filter a Computer setting based on a user or user group. You could filter it based on a computer object or computer group though.
    – joeqwerty
    Jun 9, 2012 at 1:41
1

Whenever I need to run a script at logon with a specific account or security context, I create it as a scheduled task that is triggered at logon.

You must log in to answer this question.

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