Page 1 of 1 1
Topic Options
#114191 - 2004-02-17 03:24 PM Enumerate entire network & shutdown
MichaelWassell Offline
Fresh Scripter

Registered: 2003-11-17
Posts: 32
Hello Everyone;

I'm sure that this would only take a few lines of code but I thought I would post it here for anyone with a better idea. I am in need of a script that will enumerate every netbios name on an internal network and execute the shutdown command for each pc enumerated.

I am going to be trying to put something together myself but it would be interesting to see what others have to say

#114192 - 2004-02-17 03:49 PM Re: Enumerate entire network & shutdown
Howard Bullock Offline
KiX Supporter

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
You could enumerate the names using NetView2() UDF. You then could use SHELL to execute shutdown.exe.
Home page:

#114193 - 2004-02-17 04:04 PM Re: Enumerate entire network & shutdown
Sealeopard Offline
KiX Master

Registered: 2001-04-25
Posts: 11162
Loc: Boston, MA, USA
Something like this?

dim $iRC

; set restrictive script settings

dim $asCompList, $sComp


? 'Shutting down '+ubound($asCompList)+' computers'

for each $sComp in $asCompList
if $sComp<>@WKSTA
? 'Shutting down '+$sComp
$iRC=SHUTDOWN ($sComp, 'Scheduled network-wide computer shutdown', 10, 1, 0)

? 'Shutting down '+$sComp
$iRC=SHUTDOWN ($sComp, 'Scheduled network-wide computer shutdown', 10, 1, 0)
exit 0

There are two types of vessels, submarines and targets.

Page 1 of 1 1

Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 150 anonymous users online.
Newest Members
Hdrthtsr19956, Kylie99, msmile042, rayd8, HardKn0X
17597 Registered Users

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

Search the board with:
superb Board Search
or try with google: