Categories: PowerShell

Associate SCOM Data Warehouse Profile using PowerShell

In this blog, I will explain an issue where all your Data Warehouse workflows are failing.
I will also provide a PowerShell script to fix that particular problem.

Data Warehouse workflows are extremely critical in SCOM and they needs special attention. There are many monitors which are created in order to assess the health of Data Warehouse objects and also generate alerts.

Today, I will explain a particular scenario, where one fine day you might see all your Data Warehouse workflows are failing.

There are flood of error events in the Operations Manager event log in the series of 3155*. Below is an example.

The description clearly states there is a permission issue on the Data Warehouse Database.

Let us jump into the SQL instance. But….Hold On!!!!!

There is something fishy out here…… The account in the description (NFS\2019-scomsvc-ms) is my Management Server Action Account. But ideally the Data Warehouse workflows should run under the writer account….Hmmm…that’s right.

Possible causes??

  1. Someone deleted the writer account – Possible
  2. Someone changed the writer account to Management Server Action Account – Possible.
    Let us check both the points.

    I can see my Data Warehouse Action Account still present and using the writer account. Let us move on.

  3. Someone removed the association of the Data Warehouse Run As Profile in SCOM –  Possible because in that case it will try to use the Management Server action account.
    In case you want more explain why? Read my other blog.
    http://88i.5b8.mywebsitetransfer.com/scomrunasaccountandprofile/

    Bingo!!!

Now the easy way to fix this is to compare with a working scenario and re-associate the Run As Account. But would not it be great if we just run a PowerShell script and that does the everything for us. So here goes the script.

Instructions:

  1. Either copy and save the script and run it in Powershell.exe.
  2. Or copy it PowerShell ISE and run it.
#Associate  Run As Account association in Data Warehouse and Report Deployment Run As Profile.
Write-Host "Script started.." -ForegroundColor Green

Import-Module OperationsManager

#Get the run as profiles
$DWActionAccountProfile = Get-SCOMRunAsProfile -DisplayName "Data Warehouse Account"
$ReportDeploymentProfile = Get-SCOMRunAsProfile -DisplayName "Data Warehouse Report Deployment Account"

#Get the run as accounts
$DWActionAccount = Get-SCOMrunAsAccount -Name "Data Warehouse Action Account"
$DWReportDeploymentAccount = Get-SCOMrunAsAccount -Name "Data Warehouse Report Deployment Account"

#Get all the required classes
$CollectionServerClass = Get-SCOMClass -DisplayName "Collection Server"
$DataSetClass = Get-SCOMClass -DisplayName "Data Set"
$APMClass = Get-SCOMClass -DisplayName "Operations Manager APM Data Transfer Service"
$DWSyncClass = Get-SCOMClass -DisplayName "Data Warehouse Synchronization Server"

#Setting the association
Write-Host "Setting the Run As Account Association for Data Warehouse Account Profile" -ForegroundColor Cyan
Set-SCOMRunAsProfile -Action "Add" -Profile $DWActionAccountProfile -Account $DWActionAccount -Class $CollectionServerClass,$DataSetClass,$APMClass,$DWSyncClass
Write-Host "Setting the Run As Account Association for Data Warehouse Report Deployment Account Profile" -ForegroundColor Cyan
Set-SCOMRunAsProfile -Action "Add" -Profile $ReportDeploymentProfile -Account $DWReportDeploymentAccount -Class $CollectionServerClass,$DWSyncClass


Write-Host "Script end.." -ForegroundColor Green

In case you are using Git you can pull it from the below branch.
https://github.com/Udish17/SCOM-PowerShell-Scripts/blob/SCOM-PowerShell-Scripts/master/DWRunAsProfile.ps1

Hope this was helpful.

Thanks!

Explore, Learn, Share, Repeat!

udishman

Recent Posts

Supported UNIX/LINUX Operating System in SCOM

This is a single list of all the supported UNIX/LINUX Operating System in SCOM. (more…)

54 years ago

Monitoring Rocky Linux in SCOM

Release!! SCOM 2019 UR4 and SCOM 2022 onwards support Rocky Linux 8 monitoring. In this…

54 years ago

Monitoring Alma Linux in SCOM

Release!! SCOM 2019 UR4 and SCOM 2022 onwards support Alma Linux 8 monitoring. In this…

54 years ago

Monitoring Ubuntu 20/Debian 10/Debian 11/Oracle Linux 8 in SCOM

“A picture is worth a hundreds words” : News!! News!! SCOM 2019 UR3 supports Ubuntu20.04/Debian10/Debian…

54 years ago

SCOM SCX Agent Versions

  System Center Operations Manager UNIX/LINUX (SCX) Agent Version List (more…)

54 years ago

Dual Home SCOM UNIX/LINUX Agents and Migrate – Part 2

Continuing from Part 1  where I explained how to dual home SCOM UNIX/LINUX agents (the…

54 years ago