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: execute a script in a scope of ips

HTVi
TV Discussion Newsgroups

execute a script in a scope of ips
Marcio 6/4/2007 9:47:00 PM
Hi there,
please, I would like to know, how can I execute a script in all machines in
my network, but without the use of GPO.
I would like just to type a scope of ips and it executes. Is it possible?
e.g. 192.168.0.0 to specify a network
or 192.168.0.1 - 192.168.0.50 to specify a range
Re: execute a script in a scope of ips
"Al Dunbar" <AlanDrub[ at ]hotmail.com.nospaam> 6/5/2007 5:47:22 AM

"Marcio" <Marcio[ at ]discussions.microsoft.com> wrote in message
news:7F8F6B07-4046-42D7-8C0D-120FA1BC48E4[ at ]microsoft.com...
[Quoted Text]
> Hi there,
> please, I would like to know, how can I execute a script in all machines
> in
> my network, but without the use of GPO.
> I would like just to type a scope of ips and it executes. Is it possible?
> e.g. 192.168.0.0 to specify a network
> or 192.168.0.1 - 192.168.0.50 to specify a range

Do you want to run these scripts from an administrative workstation and have
them operate on the target machines remotely, or do you want them to run as
a non-GPO-based logon script?

I'd guess the former, given your mention of IP ranges. One problem is, of
course, that some machines may not be on when you run a script remotely.

Instead of using an IP range, you could filter the output of the "net view"
command to include only those workstations in your target group, if
possible. These workstations, by definition, are all those that have been
accessible in the last 15 minutes or so. If that cannot be deduced by the
naming convention, then you might need to ping each to see if it is in your
range.

/Al


RE: execute a script in a scope of ips
Justin 6/5/2007 9:43:08 AM
On Error Resume Next

intStartingAddress = 1
intEndingAddress = 254
strSubnet = "192.168.1."

For i = intStartingAddress to intEndingAddress
strComputer = strSubnet & i

Set objWMIService = GetObject _
("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery _
("Select * From Win32_OperatingSystem")
For Each objItem in ColItems
Wscript.Echo strComputer & ": " & objItem.Caption
Next

Next

You can find it in Micrsoft Technet script center
Justin



"Marcio" wrote:

[Quoted Text]
> Hi there,
> please, I would like to know, how can I execute a script in all machines in
> my network, but without the use of GPO.
> I would like just to type a scope of ips and it executes. Is it possible?
> e.g. 192.168.0.0 to specify a network
> or 192.168.0.1 - 192.168.0.50 to specify a range

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