Posts

Showing posts from March, 2023

SCOM view missing new column

Adding a column to an existing alert view (not sure about other views) doesn't work after importing the mp. For example, adding the Icon column to alert views, sealing then importing should work but it doesn't. It also doesn't work on un-sealed mps. Even if you look at the xml you can see it's pretty straight forward to turn on/off a column's visibility (bottom red bit): < View ID="View_a6735464255541239137d1089d058738" Accessibility="Public" Enabled="true" Target="System!System.Entity" TypeID="SystemCenter!Microsoft.SystemCenter.AlertViewType" Visible="true"> <Category>Operations</Category> <Criteria> <PriorityList> <Priority>High</Priority> </PriorityList> <ResolutionState> <StateRange Operator="Equals">1</StateRange> </ResolutionState> </Criteria> <Presentation> <ColumnInfo Index="0" SortIndex=&quo

Can't import sealed mp when group is removed from old mp

Image
I had an issue with my SCOM.Cmdb mp where I added a group (and imported the mp) but I wanted to change the name of the group. I did a search/replace, sealed it then imported and got this error: There doesn't seem to be a fix for this, so I had to delete all mp dependencies and the sealed mp then re-import the new sealed mp and override mps using scripts. Nasty but it worked. Update 29/5/2023. Got this same error today when I tried to remove the McAfee mp and import the new Trellix mp. For some strange reason the SCOM.Cmdb mp had a reference to McAfee, but it also had code in there to populate the McAfee group, so I removed all McAfee bits (including the reference) then when I went to import, got the error. These are the steps I followed to fix the problem: Export all unsealed mps. We need to remove the SCOM.Cmdb mp, to do that we need to remove mps that depend on it which unfortunately is all our override mps. To get a list of them: $AllManagementPacks = Get-SCOMManagementPack $MPT

How to use Remove-SCOMDisabledClassInstance

For this to work you need to override disable the discovery, it doesn't work if the discovery is not enabled by default. Classic SCOM weirdness 😕. More info  here .

Banana oatmeal raisin cookies

Original recipe Ingredients 3 large overripe bananas 234 gm oats  1 cup almond flour 2 tsp cinnamon 1 tsp bicarb soda (baking soda) 1/4 tsp salt 80 gm raisins or sultanas  Method Preheat oven to 180C Line large baking tray with parchment paper Mash bananas in bowl Add remaining ingredients and mix by hand until combined  Make 16 cookies and place on tray. Wet hands if too sticky  Bake for 20 minutes Notes 19/4/2023 Added 50 gm chopped walnuts. 3 tsp cinnamon. Used sultanas. 8/3/2023 These turned out really nice, do again, bake time was fine. Mix was too dry so I needed 3 bananas. I found mixing by hand was easier, just mash it into a ball then cut into portions. Total weight was 630gm. Recipe says 16 cookies so 630 / 16 = 40gm each but I could only fit 15 on the tray so the last 3 were 50gm each. Next time divide weight by 15 which should be ~42gm each.

Property bag error

I was writing a PowerShell script to alert on soon-to-expire certificates from the local computer store but kept getting this error: A terminating error occurred. Error output: (Value does not fall within the expected range.). Here's the abbreviated code, solution noted in red: $MomApi=New-Object -comObject MOM.ScriptAPI # MOMScriptAPI object. $date=(get-date) $Certificates=Get-ChildItem -Path Cert:\LocalMachine\Root\ | Sort-Object -Unique foreach ($Certificate in $Certificates) { [DateTime]$NotAfter=$Certificate.NotAfter if ($NotAfter -gt $date) { [int]$CountCerts=$CountCerts + 1 $Thumbprint=$Certificate.Thumbprint [DateTime]$NotBefore=$Certificate.NotBefore $IssuedTo=$Certificate.GetNameInfo([System.Security.Cryptography.X509Certificates.X509NameType]::SimpleName, $false) # $True maps to IssuedBy column, $False maps to IssuedTo column in the Certificates mmc console. $StringNotBefore=$NotBefore.ToString("yyyy/MM/dd HH:mm:ss") $StringNotAfter=$NotAfter.ToString("yyy