0

I'm trying to edit the registry from a PowerShell script which will run on startup (through the task scheduler). Since the domain account I'm using does not have privileges I'm getting an error. Can I pass through credentials for a local admin account within the script?

Note: I need a solution that won't raise a user prompt for username/password. The script is supposed to be automated without need for user input.

Un Known
  • 179
  • 1
  • 3
  • 15
  • Why are you using the Task Scheduler? What registry setting are you trying to change? What's prompting for credentials? Not enough information in your question. – Bill_Stewart May 16 '14 at 18:26
  • So the script has to run as soon as the users logs in. I created a task in the Win 7 task scheduler for that purpose. – Un Known May 16 '14 at 21:01
  • Why Task Scheduler instead of a logon script? What are you trying to change that requires elevation? Why try to change it using the user's credentials? – Bill_Stewart May 16 '14 at 21:05
  • The registry values I'm changing are related to Group Policy (specifically, the welcome screen message). I used the solution provided by Abatonime here: "http://stackoverflow.com/questions/7690994/powershell-running-a-command-as-administrator" (4th answer) and it works, but prompts for a username/password before executing. I'm wondering if I can just pass the necessary credentials without being prompted to do so. – Un Known May 16 '14 at 21:12
  • Meaning I need to pass local admin credentials so the script can run the registry commands, even if I have to hardcore them. The logged in domain user doesn't have the privileges to run those commands, so PowerShell returns an exception – Un Known May 16 '14 at 21:15
  • Why do you need to do this? Organizations have the welcome screen configured for a reason, and it is not designed to be disabled by end users. If a machine does not need the welcome screen, it should be configured as such via GPO. You are asking how to break security design. – Bill_Stewart May 16 '14 at 21:20
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/53851/discussion-between-un-known-and-bill-stewart) – Un Known May 16 '14 at 21:24

0 Answers0