• subscribe
January 20, 2010 12:00 AM

Prevent Scripts from Running on Servers

Windows IT Pro
InstantDoc ID #103319

Listing 1: OnServerQuit.vbs

Dim instances, instance, cs

Set instances = GetObject(_

  "winmgmts://./root/cimv2")._

  InstancesOf(_

  "Win32_ComputerSystem")

 

For each instance in instances

    Set cs = instance

next

 

If cs.DomainRole > 1 Then

    WScript.Quit

End If



ARTICLE TOOLS

Comments
    There are no comments to display. Be the first one!
You must log on before posting a comment.

Are you a new visitor? Register Here