How to get list of DVD/CDROM connected to a computer using VBScript?

strComputer = "."

Set objWMIService = GetObject _

("winmgmts:" & "!\\" & strComputer & "\root\cimv2")

Set colFiles = objWMIService.ExecQuery _

How suppress activation notification using VBScript?

strComputer = "."

Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colWPASettings = objWMIService.ExecQuery("Select * from Win32_WindowsProductActivation")

How to activate windows online using VBScript?

strComputer = "."

Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colWindowsProducts = objWMIService.ExecQuery("Select * from Win32_WindowsProductActivation")

For Each objWindowsProduct in colWindowsProducts

objWindowsProduct.ActivateOnline()

Next

How to activate windows offline using a valid activation key through VBScript?

strComputer = "."

Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colWindowsProducts = objWMIService.ExecQuery("Select * from Win32_WindowsProductActivation")

For Each objWindowsProduct in colWindowsProducts

objWindowsProduct.ActivateOffline("xxxx-xxxx-xxxx") 'enter valid activation code

How to shutdown a computer using VBScript?

strComputer = "."

Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate,(Shutdown)}\\" & strComputer & "\root\cimv2")

Set colOperating Systems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")

How to restart a computer using VBScript?

strComputer = "ComputerName"

Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate,(Shutdown)}!\\" & strComputer & "\root\cimv2")

Set colOperatingSystems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")

For Each objOperatingSystem in colOperatingSystems

objOperatingSystem.Reboot()

Next

How to get a logged on user on a remote computer using VBScript?

strComputer = "ComputerName"

Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colComputer = objWMIService.ExecQuery("Select * from Win32_ComputerSystem")

For Each objComputer in colComputer

Wscript.Echo "Logged on user on " & strComputer & ": " & objComputer.UserName

How to get a list of the windows installer applications installed on the machine using VBScript?

Following VBScript retrieves the windows installer applications installed on a machine and stores in softwareList.txt file.

Set objFSO = CreateObject("Scripting.FileSystemObject")

Set objFile = objFSO.CreateTextFile("c:\softwareList.txt", True)

strComputer = "."

Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

How to join a computer to Domain and create a computer account in Active Directory using VBScript?

Const JOINDOMAIN = 1

Const ACCOUNTCREATE = 2

strDomainName = "DomainName"

strPassword = "Password"

How to delete a computer account in Active Directory using VBScript?

strComputer = "ComputerName"

set objComputer = GetObject("LDAP://CN=" & strComputer & _

",CN=Computers,DC=DomainName,DC=com")

objComputer.DeleteObject (0)

Syndicate content