Networkde bulunan diğer PC’leri scriptle kapamak.

Mart 20, 2007

Networkümüzde gerekli haklarımız tanımlanmışsa uzak bir makineyi kapatabilir,restart yada logoff edebiliriz.Bruce Walton ‘ın hazırladığı script:

———————

msg=”Yapmak istediginiz islemi seciniz:” & vbcrlf & “0 – Log off” & vbcrlf & _
“1 – Shutdown” & vbcrlf & “2 – Reboot” & vbcrlf & “8 – Power Off”

flag=inputbox(msg)

if flag<>0 and flag<>1 and flag<>2 and flag<>8 then
msgbox “Incorrect selection”
wscript.quit
end if

Servers=array(“computer1″, “computer2″, “computer3″)
for x=lbound(servers) to ubound(servers)
for each OS in getobject (“winmgmts:{(Shutdown)}//” & servers(x) & _
“/root/cimv2″).InstancesOf(“Win32_OperatingSystem”)

set Security = OS.Security_
set PrivObj = Security.Privileges
PrivObj.Add(18)

RetVal = OS.Win32ShutDown(flag,0)
next
if RetVal = 0 then
wscript.echo “Shutdown ” & servers(x)
else
wscript.echo “Unable to shutdown ” & servers(x)
end if
next

posted in Scriptler, İpucu by Anıl Erduran

Follow comments via the RSS Feed | Yorum yapın | Trackback URL

3 Comments to "Networkde bulunan diğer PC’leri scriptle kapamak."

  1. Anonim wrote:

    bu script ti tam olarak ağ içinde nasıl kullanacağız?

  2. Anıl Erduran wrote:

    Yukarıdaki scripti notdefterine alıp script.vbs şeklinde kaydederek uygulama yapabilirsiniz.

  3. Metin wrote:

    script.vbs olarak kaydedildiğinde hata veriyor.

Leave Your Comment

 
Powered by Wordpress and MySQL. Theme by Shlomi Noach, openark.org