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

Registered: 03/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 - 04/02/17 03:49 PM Re: Enumerate entire network & shutdown
Howard Bullock Offline
KiX Supporter

Registered: 00/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 - 04/02/17 04:04 PM Re: Enumerate entire network & shutdown
Sealeopard Offline
KiX Master

Registered: 01/04/25
Posts: 11161
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, Chris S., Glenn Barnas, ShaneEP, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (green78) and 144 anonymous users online.
Newest Members
Keris2112, Jorromans, qrstuv140696, Bloodboy, NIJAKIX
17451 Registered Users

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

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