15 Şubat 2014 Cumartesi

OpsMgr 2012: Enable agent proxy on all agents

Turn on agent proxy for all agents where it is disabled:
get-SCOMagent | where {$_.ProxyingEnabled -match "False"} | Enable-SCOMAgentProxy

Turn on agent proxy as a default setting for all new agents to be deployed, never to have to mess with this again:
add-pssnapin "Microsoft.EnterpriseManagement.OperationsManager.Client"; new-managementGroupConnection -ConnectionString:scomserver.domain.com; set-location "OperationsManagerMonitoring::"; Set-DefaultSetting -Name HealthService\ProxyingEnabled -Value True

Subscription Copier

Download: SubscriptionCopier.zip
Guide: SubscriptionCopierGuide.pdf
Subscriptions copier is a simple tool for copying subscriptions and helping with alert escalation. I created this tool after multiple customers have asked me why they couldn’t copy an existing subscription.
image
I have found that customers are not using subscriptions to their full potential; most customers only setup one subscription. While this works for some, I think that all alerts should be actionable. If an alert has not had some type of action taken in a given time, the alert e-mail should be re-sent or escalated to someone who can take action on it. A ticketing system such as SCSM would also fulfill this function, but few customers have their SCOM system linked to a ticketing system.

You want to make a copy of the Windows Server Team subscription and send alerts to the Windows Server Team’s manager, if they not closed within one hour. To do this today is a very manual process. You would have to open up the subscription and take a screenshot of the configuration. Then create a new subscription with the same configuration and add the Windows Team Manager to the recipients. While this works, there is a possibility that you don’t select that exact same criteria and accidently send the windows team manager an informational alert in the middle of the night that the windows team never even saw.
So let’s show how this is done with the subscription copier tool:
As you can see we have 3 subscriptions
image
Step 1: Launch the Subscription Copier Tool
image

Step 2: Type in the name of your root management server
image


Step 3: The tool will then open
image

Step 4: Select the Subscription you would like to copy from the drop down.
image

Step 5: Select how may copies you would like to make. (In this scenario we will only create one.)
image

Step 6: Select how many minutes in between re-alerts. In this scenario we will leave it at the default of 0 (This will be used in scenario 2)
image

Step 7: Check this box if you want the copied subscription enabled. (In this scenario we are leaving it unchecked because we need to make some changes before it is enabled.)
image

Step 8: Click Create
image

Step 9: You should see a message telling you that the subscription was create successfully.
image

Step 10: Open the SCOM console and refresh the subscriptions screen. You should see the copied alert under the subscriptions screen.
image

Now back to our scenario we want to alert the windows team manager if an alert has stayed open for longer than one hour.
We go to the properties of the copied alert.
image
Change the name to “Windows Server Team (Escalated to manager after one hour)” and click next
image
As you can see all of our criteria has been copied from the original subscription.
image
Click Next

Remove the Windows Team E-Mail and add Windows Server Team Manager to the subscribers
image
On the channels screen set the alert aging to 60 minutes. This will only send alerts that have been open for longer than 60 minutes to the Windows Server Team Manager
image
On the Summary Page click “Enable this notification subscription.
image
Then click Finish
image

You want a subscription to re-alert on open alerts every 10 minutes for one hour. To do this today you would have to open up the subscription and take a screenshot of the configuration. Then create six new subscriptions with the same configuration and set the delay by adding an extra ten minutes to every subscription. This could take up to 10 minutes manually. If you were to do this for every subscription in your environment it could take many hours.
So let’s see how this is done with the subscription copier tool
Step 1: Launch the Subscription Copier Tool
Step 2: Type in the name of your Root Management server
Step 4: Select the Subscription you would like to copy from the drop down.

Step 5: Select how may copies you would like to make. In this scenario we will create six.
image
Step 6: Select how many minutes between each re-alert. In this scenario we will set it to 10 minutes.
image


Step 7: Check the enabled box to enable the 6 subscriptions we are going to create.
image

Step 8: Click Create
Step 9: It will take a short time as the copies are created. After it completes you should see a message telling you that 6 subscription copies were created at a 10 minute interval.
image

Step 10: Open the SCOM Console and refresh the subscriptions screen.
image


You should now see the copied subscriptions created by the tool.

  • When creating multiple copies with a re-alert interval. Set your subscription criteria to only include only
Reason: When your subscription criteria includes closed alerts, the closed alerts get delayed and you will get some a bunch of extra closed alerts that you won’t want.

  • If you have subscriptions with duplicate names you will get an error of “An entry with the same key already exists”.
Workaround: Delete subscription(s) with duplicate name
  • Copied subscriptions with a delay set. The delay doesn’t interval doesn’t get copied.
Workaround: Manually set the delay on copied subscriptions

Subscription Copier

Download: SubscriptionCopier.zip
Guide: SubscriptionCopierGuide.pdf
Subscriptions copier is a simple tool for copying subscriptions and helping with alert escalation. I created this tool after multiple customers have asked me why they couldn’t copy an existing subscription.
image
I have found that customers are not using subscriptions to their full potential; most customers only setup one subscription. While this works for some, I think that all alerts should be actionable. If an alert has not had some type of action taken in a given time, the alert e-mail should be re-sent or escalated to someone who can take action on it. A ticketing system such as SCSM would also fulfill this function, but few customers have their SCOM system linked to a ticketing system.

You want to make a copy of the Windows Server Team subscription and send alerts to the Windows Server Team’s manager, if they not closed within one hour. To do this today is a very manual process. You would have to open up the subscription and take a screenshot of the configuration. Then create a new subscription with the same configuration and add the Windows Team Manager to the recipients. While this works, there is a possibility that you don’t select that exact same criteria and accidently send the windows team manager an informational alert in the middle of the night that the windows team never even saw.
So let’s show how this is done with the subscription copier tool:
As you can see we have 3 subscriptions
image
Step 1: Launch the Subscription Copier Tool
image

Step 2: Type in the name of your root management server
image


Step 3: The tool will then open
image

Step 4: Select the Subscription you would like to copy from the drop down.
image

Step 5: Select how may copies you would like to make. (In this scenario we will only create one.)
image

Step 6: Select how many minutes in between re-alerts. In this scenario we will leave it at the default of 0 (This will be used in scenario 2)
image

Step 7: Check this box if you want the copied subscription enabled. (In this scenario we are leaving it unchecked because we need to make some changes before it is enabled.)
image

Step 8: Click Create
image

Step 9: You should see a message telling you that the subscription was create successfully.
image

Step 10: Open the SCOM console and refresh the subscriptions screen. You should see the copied alert under the subscriptions screen.
image

Now back to our scenario we want to alert the windows team manager if an alert has stayed open for longer than one hour.
We go to the properties of the copied alert.
image
Change the name to “Windows Server Team (Escalated to manager after one hour)” and click next
image
As you can see all of our criteria has been copied from the original subscription.
image
Click Next

Remove the Windows Team E-Mail and add Windows Server Team Manager to the subscribers
image
On the channels screen set the alert aging to 60 minutes. This will only send alerts that have been open for longer than 60 minutes to the Windows Server Team Manager
image
On the Summary Page click “Enable this notification subscription.
image
Then click Finish
image

You want a subscription to re-alert on open alerts every 10 minutes for one hour. To do this today you would have to open up the subscription and take a screenshot of the configuration. Then create six new subscriptions with the same configuration and set the delay by adding an extra ten minutes to every subscription. This could take up to 10 minutes manually. If you were to do this for every subscription in your environment it could take many hours.
So let’s see how this is done with the subscription copier tool
Step 1: Launch the Subscription Copier Tool
Step 2: Type in the name of your Root Management server
Step 4: Select the Subscription you would like to copy from the drop down.

Step 5: Select how may copies you would like to make. In this scenario we will create six.
image
Step 6: Select how many minutes between each re-alert. In this scenario we will set it to 10 minutes.
image


Step 7: Check the enabled box to enable the 6 subscriptions we are going to create.
image

Step 8: Click Create
Step 9: It will take a short time as the copies are created. After it completes you should see a message telling you that 6 subscription copies were created at a 10 minute interval.
image

Step 10: Open the SCOM Console and refresh the subscriptions screen.
image


You should now see the copied subscriptions created by the tool.

  • When creating multiple copies with a re-alert interval. Set your subscription criteria to only include only
Reason: When your subscription criteria includes closed alerts, the closed alerts get delayed and you will get some a bunch of extra closed alerts that you won’t want.

  • If you have subscriptions with duplicate names you will get an error of “An entry with the same key already exists”.
Workaround: Delete subscription(s) with duplicate name
  • Copied subscriptions with a delay set. The delay doesn’t interval doesn’t get copied.
Workaround: Manually set the delay on copied subscriptions

Subscription Tool

Download: SubscriptionTool.zip
Source Code: SubscriptionTool Source Code.zip

Subscription Tool is a simple GUI based tool that lets you enable and disable all notification subscriptions.   This tool is useful if you need to do some major maintenance such as patches, upgrading hardware, redoing AD integration roles, or fixing a major problem. 
The real power of the tool is when you want to re-enable the subscriptions.    The tool will automatically re-enable all subscriptions using “Send notifications for alerts Generated after the subscription is enabled”.  This will save you from sending out huge alert storms your notification subscriptions.


updatetool
 
If you are not familiar with this, disable and then re-enable a subscription inside the ops mgr console.  You will notice when you re-enable the subscription you get the dialog box below.
enable
 
You could enable and disable all subscriptions with powershell using
“Get-NotificationSubscription | Disable-NotificationSubscription”
But powershell uses the default  “Send notifications for alerts Generated since the subscription is disabled  (potentially causing an Alert Storm).   There are no options inside powershell to do this unless you leverage the .net objects directly.