Jump to content

Recommended Posts

Posted

We're currently having some kind of DNS issue on our network and a local workaround is to

ipconfig /registerdns

 

I would like to (untill the issue is resolved) add this to the login script, but i requires admin rights.

Is there a way that I can do this in the login script with a runas? Unless somebody knows another way around this.

 

Thanks

Posted

You could put it in the machine startup script instead then you would not need to elevate the command.

 

Run a script on Windows startup without a user logged on - Stack Overflow

Windows 2000 and above offer a "Startup Scripts" item in the policy editor:

 

Computer Settings -> Windows Settings -> Scripts (Startup/Shutdown)

 

There's an equivalent logon script area (once a user has logged on) in the User configuration bit.

 

The computer startup scripts run in the computer context, i.e. LocalSystem, as you noted, so they often can't access network drives and so on.

 

A startup script is a quick and easy way of getting a process running when the machine boots. The computer startup process will be affected by the time it takes to run the program, though, so you might want to ensure you call it with the START command from a batch file, or specifying not to wait for the executable to complete from whatever script language you use. (the key point there is: run the script asynchronously unless it's critical, or doesn't need to be run asynchronously cos it will always take no time at all. Long boots = unhappy users).

  • Thanks 2
Posted

Hello,

 

Not sure the RUNAS command could be used as simply, I don't think it would allow you to put in a password IIRC.

 

VBS would be a better option as it has the option to impersonate

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...