Issue:-First time when you launch PowerShell and try to run any PowerShell scripts file, it will not run and gives the below error. Here I am trying to run a simple ps script “directory.ps1” with Get-Chitditem cmdlet inside it."File C:\ZAid\Testing\Script.ps1 cannot be loaded because the execution of scripts is disabled on this system. "When PowerShell … Continue reading Powershell execution of scripts is disabled on this system
Tag: Script
Monitor Disk Space
In the following script, you monitor the disk space on a server to let you know when it falls below 100000000 bytes. If the free space falls below 100000000, a message is echoed to the screen every 5 seconds.Option ExplicitOn Error Resume NextConst FIVE_SEC = 5000Const LOCAL_HARD_DISK = 3Dim colMonitoredDisks Dim objWMIService Dim objDiskChange Dim i Set … Continue reading Monitor Disk Space
To get Model String
For Drivers deployment , we need to find the exact Manufacturer and Model to deploy using SCCM. s We need to create WMI Query to install the Driver Package based on Make & Model.Set objShell = CreateObject("WScript.Shell")Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")strWinDir = objShell.ExpandEnvironmentStrings("%WinDir%")Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem")For Each objItem In colItems … Continue reading To get Model String
SCOM command line to remove Management Group Config
This is a command line option to remove a Management group configuration from an agentMsiExec.exe /i \\path\MOMAgent.msi/norestart /qn /l*v %temp%\RemoveMG.log MANAGEMENT_GROUP= MANAGEMENT_GROUP_OPERATION=RemoveConfigGroup REINSTALL=ALL