Archive for the ‘Powershell’ Category

Updating Custom Fields using PowerShell

June 1, 2010 2 comments

The question of how to update custom fields using PowerShell comes up quite often on the technet forum so I have tried to give a variety of approaches here on how to achieve this. PowerShell does seem to be quite resource intensive so keep a close eye on your RMS if you are running PowerShell scripts on a schedule and also test all of these scripts in a suitable test environment before deploying.

Here is the run through –

Is this alert generated by a rule or monitor?

March 9, 2010 Leave a comment

#get all alerts
$alerts = get-alert

#get only alerts generated by a monitor and not closed $alerts = get-alert | where {$_.IsMonitorAlert -eq $true -and $_.ResolutionState -ne 255}

#format a table with alert info
$alert | sort-object LastModified, Name | ft Name, LastModified

#print number of alerts

#get only alerts generated by a rule and not closed $alerts = get-alert | where {$_.IsMonitorAlert -eq $false -and $_.ResolutionState -ne 255}

Categories: Powershell

How we can find the total number operator console or web console opened at any given point?

February 27, 2010 Leave a comment

An interesting forum question:

Thanks to LayneR who explains that the latest version of the Operations Manager 2007 R2 Management Pack includes a collection rule and a performance view called “Console and SDK Connection Count” under the folder Operations Manager\Management Server Performance.

He also provides a powershell script to list the users connected:
Get-ManagementGroupConnection | foreach-object {$_.ManagementGroup.getConnectedUserNames()}

Categories: Consoles, Operator, Powershell