SCOM Powershell Command to check if Server is Physical or Virtual
- Get-SCOMaccesLicense where DEVICE_ID "Computername"
- This will give you information whether the server is Virtual or Physical.Its agent managed or Agentless Managed.
SQL query to find out if your SCOM 2012 R2 Grooming jobs are succeeding:
- Grooming jobs are very important in SCOM.
- If grooming fails then your old data is not removed as per your grooming settings.
- This will cause your database to fillup and also cause slowness.
- You need to regularly monitor the Grooming jobs are will face a outage.
- Unfortunately, SCOM only raise alert if the grooming fails for atleast 6 days.
- So by this time depending on your environment there could be lot of issues and grooming could never be completd
- So i came up with SQL query which you can use to daily check after 6:00 AM server time
- "SELECT * FROM INTERNAJOBHISTORY ORDER BY INTERALJOBHISTORYID DESC"
- Run the above query and check if the grooming jobs succeeds. You should do this daily to avoid our OperationsManager Database gets filled.
VBSCript to check if file exist and update scom
Dim oAPI, oBag
Set oAPI = CreateObject("MOM.ScriptAPI")
Set oBag = oAPI.CreatePropertyBag()
Set objFSO = CreateObject("Scripting.FileSystemObject")
strFile = "C:\MYFILE.LOG"
If objFSO.FileExists(strFile) Then
Call oBag.AddValue("Status", "OK")
Else
Call oBag.AddValue("Status", "Error")
Call oAPI.Return(oBag)
End If
How to Check if Powershell is installed on your Computer?
- To check if Powershell is installed on your Computer
- Go to C: Drive and Click on "Windows" Folder
- Now click on Sytem32 folder then Click on "WindowsPowerShell" Folder
- Now depending on the Version of Powershell installed You will se it as v1.0 or v2.0 or v3.0. This tell you what version of Powershell is installed.
- Now in our case is v1.0. Click on v1.0 folder.
- You will see a "Powershell.exe". This confirms that Powershell is installed on your system.