Re: run once
From: Richard Mueller [MVP] (rlmueller-NOSPAM_at_ameritech.NOSPAM.net)
Date: 03/10/04
- Next message: Joe: "enabling the 'User Can Not Change Password' option"
- Previous message: Torgeir Bakken (MVP): "Re: run once"
- In reply to: Aaron: "run once"
- Next in thread: Brad Fox: "Re: run once"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 10 Mar 2004 12:02:50 -0600
Aaron wrote:
> Is there anyway to write a script that would only run once during startup
or
> login on each computer in the domain or group?
>
Hi,
For many years I used "Flag" files. This was in the days of Win95 and batch
files (before SMS). The logon script checked for a "flag" file. If it did
not exist, the batch program did whatever, then saved the "flag" file. If
the modification was to the machine, I saved the file to the hard drive. If
the change applied to the user, the flag file was saved in the home
directory. I also appended to a log file in a central shared location. I
wanted a way to tell when everyone was updated so I could remove the code
from the logon script. If something had to be pushed out again, we could
instruct users to delete the "flag" file, or we could do it for them if it
was in the home directory. If we screwed up and had to fix a bug in the
script, we used a different "flag" file. We had a folder in a standard
location for these.
Later, we used registry entries - in HKLM for things done once per machine,
in HKCU for things done once per user. If the registry entry exists, skip,
otherwise do whatever and save the registry entry. Note that logon scripts
can add to HKCU, but you usually need a startup script to add to HKLM. I
still like to log to a central location so I can tell when to retire code
from the logon or startup script.
Another option might be to use Group Policy software installation, depending
on what you are doing and your clients. And, if all your clients have WMI,
you can monitor and even push out modifications. I used this to push out
patches before discovering SUS. The code I used could be used to push out
just about anything.
-- Richard Microsoft MVP Scripting and ADSI HilltopLab web site - http://www.rlmueller.net --
- Next message: Joe: "enabling the 'User Can Not Change Password' option"
- Previous message: Torgeir Bakken (MVP): "Re: run once"
- In reply to: Aaron: "run once"
- Next in thread: Brad Fox: "Re: run once"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|