Pushing a .vbs through GPO

lockmac

Senior member
Dec 5, 2004
603
0
0
Hi guys.
I have a .vbs script that I need to run on the computers in my domain. The script only needs to be run once.

How can I go about deploying this? Is their a way through the GPO where it will only happen once? Can I put it in a login script and have it only do it once?

If I was to do it in a loginscript (which could be better as not all computers are always on), how would I go about the script knowing if it has already been run on the computer before?

Basically, the script deletes the GAL out of Outlook, and it will get recreated when the user goes back into Outlook. We only need to do this ever so often as when an employee leaves the company, even if we remove their email address, it still stays in a user's address book (Google Apps).

Any advice appreciated.

Cheers
 

snikt

Member
May 12, 2000
198
0
0
Yes it can be deployed with a GPO in AD. Look in User Configuration > Window Settings > Scripts (Logon/Logoff). You can add it to either, we have our scripts to run at Logon. Keep in mind, unless you specify somewhere in the script not to run if the GAL has been deleted the script will always run until you remove it from the GPO. Hope that works for you.
 

theevilsharpie

Platinum Member
Nov 2, 2009
2,322
14
81
I've solved this problem in the past by writing something a value to the registry after the script finished running. The next time the script ran, it read the registry, and the exited if it found the value.
 

lockmac

Senior member
Dec 5, 2004
603
0
0
I've solved this problem in the past by writing something a value to the registry after the script finished running. The next time the script ran, it read the registry, and the exited if it found the value.

Great. I think this this registry is a good idea. Any ideas where the best palce in the registry is? I might create a key that is just a date of the last time that script was run and it can go up from there