Showing posts with label get. Show all posts
Showing posts with label get. Show all posts

Wednesday, 6 April 2016

How to get list of All commands for SCOM 2012 R2 Module in Powershell

How to get list of All commands for SCOM 2012 R2 Module in Powershell


  • Today i am going to Show you how get list of all commands available in SCOM module.
  • First Open the Powershell and Import the SCOM module
                    Import-Module OperationsManager
  • This will load the SCOM module in Powershell
  • Then to see all the commands in the OperationsManager Modulle type the below command
                   get-command - module OperationsManager | more
  • This will list all the commands in SCOM.

Tuesday, 15 March 2016

SQL query to get all Distributed Applications created by users in SCOM

SQL query to get all Distributed Applications created by users in SCOM


  • Distributed Application are stored in SCOM in ManagedEntity Table
  • All Distributed Applications created by users start with "Service_" in the FullName column
  • If you want to query all your distributed application that are created for reporting purpose use the below query
***********
SELECT * FROM [OperationsManagerDB].[ManagedEntity] where (FullName like 'Service_%' AND Name is NULL)

*****************


Sunday, 7 February 2016

SQL Query to get the Maintenance Mode History for Particular Server SCOM 2016


SQL Query to get the Maintenance Mode History for Particular Server SCOM 2016



  • Many time you get questions from Management whether the particular server was in Maintenance mode and how long.
  • It has always been a challenge for SCOM engineer to pull the Data, as there is now easy way to pull this information.
  • You can use the below SQL query to get that information.
  • What this query does is that it queries the "OperationsManagerDW" database in "ManagedEntity"  table "MaintenanceMode" Table and "MaintenacenModeHistory" table where the ManagetEntity Row ID matches Maintenance mode Manage entity RowID and Maintenance Mode RowId matches Maintenance Mode Manage Entity Row ID.
  • Replace the "Servername" with server name you wan the report for and you will get the Maintenance mode History report for the server


********************
USE OperationsManagerDW
SELECT ManagedEntity.DisplayName, MaintenanceModeHistory.*
FROM ManagedEntity WITH (NOLOCK) 
INNER JOIN
MaintenanceMode ON ManagedEntity.ManagedEntityRowId = MaintenanceMode.ManagedEntityRowId 
INNER JOIN
MaintenanceModeHistory ON MaintenanceMode.MaintenanceModeRowId = MaintenanceModeHistory.MaintenanceModeRowId
where DisplayName Like '%servername%'

*******************

Tuesday, 1 September 2015

PowerShell Command to get Specific Alert in SCOM 2012 R2 and SCOM 2016

PowerShell Command to get Specific Alert in SCOM 2012 R2 and SCOM 2016


  • Powershell Command to get only Specific alert with Specific Name is something we are asked frequently
  • Use the Below Command to get it done
  • GET-SCOMAlert Where {$_.Name --eq "Alert You want to get"}

Tuesday, 28 July 2015

SCOM 2012 R2 Data warehouse command to get information on Various Tables and how much space they are talking

SCOM 2012 R2 Data warehouse command to get information on Various Tables and how much space they are talking


  • SCOM Data warehouse is the one where we store all data for longtime.
  • Usually this will be in terabytes of data and will fill very fast if not confiureged properly
  • Most offten you can see that the Datawarehouse if Full or going to be full and you want to find out what is the configuration and which Table is taking the most data
  • Microsoft has pushed a command line tool in SCOM 2012 R2 called dwdatarp.exe
  •  To get the list of tables using more space and configuration use the below command

dwdatarp.exe -s SQLServer\DatabaseName -d OperationsManagerDW > c:\dwoutput.txt


  • This will give you the output with Space used and the How many days of data is stored.

Monday, 27 July 2015

Command to Get List of Patches installed on Windows 2008 R2 and Windows 2012

Command to Get List of Patches installed on Windows 2008 R2 and Windows 2012


  • Manytime we get request from application owners who request for list of patches instaled and on what date
  • You can use the below command to get the list of Patches from the server. This will Create a html file called hotfix.html in your C: drive.
  • wmic qfe list brief /format:htable > "c:\hotfix.html"

Sunday, 21 June 2015

Powershell Script to get Event from Application Event Log

Powershell Script to get particual Event from Application Event Log



.You can use the below script to get Eventlog message using Powershell.

$Server='Your Computer Name"
$Yesterday="From Date in DD/MM/YYYY format"
$Today="To Date in DD/MM/YYYY format"
$Event = "Event ID you are looking for"
Get-EventLog -ComputerName $Server -LogName "Application" -after $Yesterday -before $Today| where {$_.EventID -eq $Event}

Tuesday, 17 February 2015

Scom tutorial to get primary management server

1. Scom is pretty powerful tools to get the management server
2. To get the primary management server use.
3. The powershell command get-primarymangementsever

Sunday, 4 January 2015

How to get the RUN window in Windows Server 2012 R2

How to get the RUN window in Windows 2012


  • To get the Run Windows in Current version You just click on Start and search for Run and it will show up.
  • To get the Run windows in Windows 2012. Right Click on the Start Button.It will show the Run Program there.Click on it and you will get the Run Windows