IT admim's: help with logon script..

Associate
Joined
8 Mar 2007
Posts
2,176
Location
between here and there
hey all,

We're currently about to add a new email server to one of our offices. Currently everyone (both offices) are using the same server and everyone has the server name in their outlook account setup .

To make things easier in the move, I've decided to edit everyone's hosts file in the office thats getting a new server to include the old servers name and current ip address. I will then change the DNS records once the server is running and start removing the hosts file i put in.

This way I don't have to go to every machine and open outlook and reconfigure it. (ball ache, as I've got about 150 people in that office!)

Now, I've written me a fab little vbs script thats starts at logon via a GPO and it does everything I could ever have asked of it, however it only works when run as an administrator.


Is there a way to start a vbs script as administrator via GPO like this???

I've tried 'runas' and that won't start a vbs script as it seems to only do .exe's. I've also tried psexec (an old favourite of mine) but it doesn't seem to run the script.

I've also tried running the script from startup instead of logon as I beleive startup runs within the system account, but the scripts fails to rename and copy in a new hosts file.

Any ideas anyone???

Cheers in advance!
 
Last edited:
I have a printer.vbs script that runs on logon to map printers dependent on computername.

It runs fine without any specific need to run as administrator.

Have you checked as to why it isnt running? And only running as administrator? Sounds like permissions on either the vbs file or permissions on what you are asking the vbs script to do.
 
adding network drive a printer don't require admin rights.

I'm trying to replace a file stored in the c:\windows\system32\drivers\etc folder.

This location is unaccessible to the user. "access denied"

Hence the need to run the vbs script as administrator.
 
Last edited:
Have you tried running it as a startup script instead of a login script? (ie apply it to the computers, not the users).

I did do this at first because I'm aware of the differences between them, however it didn't run either so i started looking down the elevate permissions route.

I've since had another crack at the startup script and I managed to get it to run on a bog standard user machine.

So fingers crossed it should be ok now.

I'll leave it for a bit and get some people to restart their machines at lunch and we'll see what happens.

Cheers dude.
 
What email server is this btw? I assume not exchange as it automatically re-homes profiles/accounts when mailboxes are moved to different servers!


If not ignore me, I have no idea about your runas admin GPO issue I'm afraid.
 
Hi mate

Try using a programme called Lsrunase. This allows you to run the install as a Domain Administrator on the users PC but it encrpyts the password so they wont see it. You will also need LSencrypt which generates the password in encrypted form

Should do the trick. Let me know if you are struggling to get it though and I will send it you. It is free

Cheers
Baz
 
cheers for the replies guys.

No it's not an exchange server. Sadly we're still stuck in the mid 80's with POP3!!

Anyways, I managed to get it to run ok. I changed it to be a startup script instead on logon and it did the trick.

Cheers again for all your help.

:)
 
Back
Top Bottom