Page 1 of 1 1
Topic Options
#71335 - 2002-10-31 02:56 PM WriteValue() with a non administrative logon
NetTech Offline
Fresh Scripter

Registered: 2002-07-02
Posts: 20
I changing out DNS and WINS throughout the network, something like 2000 users running WIN2k. I am using the WriteValue in my script to change the wins and dns values in their respected subkeys. I noticed that when I logon (me being an admin) the script runs no prob, but when a domain user logs on the script runs but no change to the subkeys. Can someone help me with a script that will work around this?
Top
#71336 - 2002-10-31 02:59 PM Re: WriteValue() with a non administrative logon
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Either run it as an admin script remotely or push it as a Task Scheduled script.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#71337 - 2002-10-31 04:00 PM Re: WriteValue() with a non administrative logon
NetTech Offline
Fresh Scripter

Registered: 2002-07-02
Posts: 20
How do I go about doing an admin script remotely to 2000 users?
Top
#71338 - 2002-10-31 04:08 PM Re: WriteValue() with a non administrative logon
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
You would either make a text file of the computer names you wish to update or enumerate the computers in the domain.

For each computer you will use you WriteValue() functions but include "\\$computername\" before HKLM in the key definition.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#71339 - 2002-10-31 05:29 PM Re: WriteValue() with a non administrative logon
Night Hawk Offline
Fresh Scripter

Registered: 2002-10-09
Posts: 33
Loc: NC, USA
May be this can get you started i used it to change the dns settings on 50 or 60 remote computers. the dns .txt being a list of the ones i wanted to change and i used the sms.ini to verify the pc was on line..

open(1,"c:\dns.txt")
$pc = readline(1)
$sms = "\\$pc\c$\sms.ini"
while $eof = 0
$eof = @error
RedirectOutput("$logfile")
IF RedirectOutput("$logfile" ) = 0

if exist("$sms")
$dns =Readvalue("\\$pc\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters","Hostname")
? "$pc DNS was Set to $dns"

;writevalue("\\$pc\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters","Hostname","$pc","REG_SZ")
; $dns =Readvalue("\\$pc\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters","Hostname")
; ? "$pc DNS IS now set to $dns"

;$dns1 =Readvalue("\\$pc\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters","Hostname")
? "$pc DNS was NOW Set to $dns1"

endif
endif
$pc = readline(1)
loop
close(1) [Roll Eyes] [Roll Eyes]

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 724 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.153 seconds in which 0.118 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org