Werbung: SecurityConsole.de verwaltet Ihre Computer mit Security Essentails aus der Cloud!
30 Tage kostenfrei testen und 20% Rabatt für Ihre Bestellung mit Promocode: WBF2685582
(Promocode gültig bis 31.12.2011)

Group:  English: Windows Server » microsoft.public.windows.server.scripting
Thread: Logon Script Assistance

HTVi
TV Discussion Newsgroups

Logon Script Assistance
motko 5/8/2007 7:14:03 PM
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?

Your assistance is much appreciated.
Re: Logon Script Assistance
"Richard Mueller [MVP]" <rlmueller-nospam[ at ]ameritech.nospam.net> 5/8/2007 11:41:40 PM
motko wrote:

[Quoted Text]
>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
--


Re: Logon Script Assistance
motko 5/9/2007 9:56:02 PM
Richard,

Thanks much for the info! Sounds like I may go with the group membership
option.

Matt


"Richard Mueller [MVP]" wrote:

[Quoted Text]
> 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
> --
>
>
>

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net
Suche nach Orten, Städten, Postleitzahlen, Vorwahlen, Kfz-Kennzeichen