> motko wrote:
>
> >I am currently building 4000 new PCs. I add the new PC names to a text
> >file
> > that the logon script checks. If the name is found in the text file it
> > calls
> > another script to install some post-build fixes. Is there a way to have
> > the
> > script remove the computer name from the text file once complete?
>
> The only way a script can modify a text file is to read the original, write
> to a copy, then delete the original, and rename the copy. However conflicts
> occur if the script is run from more than one computer simultaneously.
>
> Are you sure that all users have permissions to run the fixes? If the fixes
> affect all users, I would expect non-admin users to not have sufficient
> rights. A startup script runs with System privileges on the local computer,
> which should allow most fixes.
>
> What you need is a mechanism to ensure that the fixes are only applied once
> on each computer. I assume that the fix should only be applied to the
> computers in the text file, rather than to all computers.
>
> One solution would be to have the script check for the name in the text
> file. If the computer name is in the file, then check for the existence of a
> local file. If the local file does not exist, run the fix, then save the
> local file so the fix is not applied again. The disadvantage of this
> solution is that you don't know which computers have had the fix applied.
>
> Another solution is to use a domain group instead of the text file of
> computer names. Add each of the computers that need the fix to the group.
> The Startup script checks to see if the computer is a member of the group.
> If it is, it runs the fix, then removes the computer from the group. This
> requires that the computer object has permissions to modify the group
> membership. You can grant the group "Domain Computers" permissions to modify
> the group membership. The advantage of this solution is that you can tell
> which computers got the fix and which still need it.
>
> --
> Richard Mueller
> Microsoft MVP Scripting and ADSI
> Hilltop Lab -
http://www.rlmueller.net> --
>
>
>