Month: March 2013

How To Check Remote And Local Server Services Script

Const strSVCName = “ServicesName” Dim objWMIService, colServices, objService, strComputer strComputer = “ServerName” Set objWMIService = GetObject(“winmgmts:” _ & “{impersonationLevel=impersonate}!\\” & strComputer & “\root\cimv2”) Set colServices = objWMIService.ExecQuery(“Select * from Win32_Service WHERE DisplayName = ‘” & strSVCName & “‘”) For Each objService in colServices if objService.State = “Running” then Set objEmail = CreateObject(“CDO.Message”) objEmail.From = “test@test.com”

Script1.ps1 cannot be loaded because running scripts is disabled on this system

script1.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at http://go.microsoft.com/fwlink/?LinkID=135170 This error happens due to a security measure which won’t let scripts be executed on your system without you having approved of it. You can do so by opening up a powershell with administrative rights (search