Problems with new-TestCasConnectivityUser.ps1

When we tried to run new-TestCasConnectivityUser.ps1 to create some mailboxes for the test-cmdlets we ran in to some strange problems.

Got an errormessage stating “CreateTestUser : Mailbox could not be created. Verify that OU ‘Users’ exists and that password meets complexity require”

The OU exist and the password is OK… strange. Googled and didn’t find anything that could relate to that problem. Then I started to disect/debug the powershell script…

Ended up with a command like:

$SecurePassword = Read-Host "Enter password" -AsSecureString
new-Mailbox -Name:ext_dummy -Alias:ext_dummy -UserPrincipalName: -SamAccountName:ext_dummy -Password:$SecurePassword -Database:somestrangeguid -OrganizationalUnit:Users

When running that command it says that “Multiple organizational units match identity “Users”. Specify a unique value.”

OK, we have another OU in the hierarchy named “Users”…
Edited the script and changed the value of $OrganizationalUnit to another OU and did a new test with “get-mailboxServer | .\new-TestCasConnectivityUser.ps1″ and a few seconds later we have the users. :-)


Demo Webservice

A while ago I wrote a little PHP-application for demostrating webmonitors in System Center Operations Manager 2007.
It will probably work for any monitoring solution that catches http errorcodes or textstrings on a page.

Free to use, so give it a try. :-)

You can find it at: https://snowland.se/demo/


OpsMgrDW Grooming

After a while my demo environment with OpsMgr data warehouse (and loads of other stuff) needed some more space.

I haven’t looked in to grooming of the DW before. So as usual Google is a nice friend. :-)

Stefan Stranger has a nice post with loads of grooming information.

So what I did was to download the dwdatarp tool.

First I ran it to see the current status

dwdatarp.exe -s SNWSQL01 -d OperationsManagerDW

Looks like most of the datasets are stored 400 or 180 days… That is somewhat to much data for a demo environment.
I took the values and divided them by 4. Then ran the following to free up 75% of the database.

dwdatarp.exe -s SNWSQL01 -d OperationsManagerDW -ds Alert -a Raw -m 100
dwdatarp.exe -s SNWSQL01 -d OperationsManagerDW -ds "Client Monitoring" -a Raw -m 8
dwdatarp.exe -s SNWSQL01 -d OperationsManagerDW -ds "Client Monitoring" -a Daily -m 100
dwdatarp.exe -s SNWSQL01 -d OperationsManagerDW -ds Configuration -a Raw -m 100
dwdatarp.exe -s SNWSQL01 -d OperationsManagerDW -ds Event -a Raw -m 25
dwdatarp.exe -s SNWSQL01 -d OperationsManagerDW -ds Performance -a Raw -m 45
dwdatarp.exe -s SNWSQL01 -d OperationsManagerDW -ds Performance -a Hourly -m 100
dwdatarp.exe -s SNWSQL01 -d OperationsManagerDW -ds Performance -a Daily -m 100
dwdatarp.exe -s SNWSQL01 -d OperationsManagerDW -ds State -a Raw -m 45
dwdatarp.exe -s SNWSQL01 -d OperationsManagerDW -ds State -a Hourly -m 100
dwdatarp.exe -s SNWSQL01 -d OperationsManagerDW -ds State -a Daily -m 100

OK… when you have a database full of free space you need to truncate it, but that’s another story…


OpsMgr-install – SQL Cluster and IP-Sec

At a customer-site today we discovered some interesting things installing a few OpsMgr management servers.

The scenario is:
- A active/active SQL Cluster running SQL 2005 SP3 (This is where we want to host the OpsMgr-database)
- A couple of Server 2008 as RMS and MS

When you install the database on you run the setup on one of the clusternodes… works fine.

Then… when it’s time to install the RMS the problems kicks in.
A few steps in to the setup you are prompted to name the SQL-Server, Databasename and what port… this works fine.
The next steps are for the accounts you want to use…
Then when at the end of the progress bar the text says something like “Executing SQL Strings” it fails.

If you look in to the log file you can see that it cant create a connection to the SQL Server, kinda strange since it did verify that the database existed in the step where you point out server and name.

After trying everything we started to create logs… massive amount of logs, traces and dumps.
We couldn’t see that the msiexec tried to connect to the SQL… so after googling, reading and googling some more we found the problem.

IP-Sec and the broker-service.

What happens is that the msiexec tries to connect to the SQL Server, what it does in a clustered environment is that it talks to the SQL Broker who then says “Hey the instance you are looking for is located on port 123″… But, when the broker responds, it doesn’t respond from the same IP as the SQL server.

And what do a standard IP-Sec-setup do with packages from “another” IP… drop.

So, to work around this you need to install the SQL Client on the RMS/MS.
Then set up an alias (32-Bit alias if you are using a x64, if you are using a x86 you don’t have to bother) that’s named the same as the SQL-Server and with the right port.
When that’s done you can install your RMS or MS.


Monitor connected consoles

A small and simple script to monitor number of connected SCOM-consoles.

Set oLocator = CreateObject("WbemScripting.SWbemLocator")
Set oWmi = oLocator.ConnectServer(".", "root/snmp/localhost", "")
Set oStats = oWmi.ExecQuery("select * from SNMP_RFC1213_MIB_tcpConnTable where tcpConnLocalPort = 5724 AND tcpConnLocalAddress <> '0.0.0.0' AND tcpConnLocalAddress <> '127.0.0.1'")

Set oAPI = CreateObject("MOM.ScriptAPI")
Set oBag = oAPI.CreatePropertyBag()
oBag.AddValue "ConnectedConsoles", oStats.Count
oAPI.AddItem(oBag)
oAPI.ReturnItems

Re-notify users of a alerts

This little powershell-script will update all alerts with resolutionstate “New” and an age of at least 24 hours… and with that done the users subscribing to that alert will get a new notification.

$UpdateAlerts = Get-Alert | where { $_.ResolutionState -eq 0 -and $_.LastModified -lt (get-date).AddHours(-24) }

foreach ($alert in $UpdateAlerts) { $alert.Update("Renotify operators of an untouched alert open for 24 hours") }

PSOL: Resolve informational alerts without repeatcount

To get rid of a large number of alerts in SCOM you can of course use PowerShell…

This script will take informational alerts without any repeats that are 24 hours old and simply resolve them with a small comment.

get-alert | where { $_.Severity -eq 0 -and $_.RepeatCount -eq 0 -and $_.ResolutionState -eq '0' -and $_.LastModified -lt (get-date).AddHours(-24)} | Resolve-Alert -comment "Alert resovled via script (24 hours old informational alert without repeatcount)" | Format-Table MonitoringObjectPath, Name, TimeRaised

(Change “$_.RepeatCount -eq 0″ to “$_.RepeatCount -lt 3″ to get alerts with less then 3 repeats)


SCOM Alerts Severity and Priority

I don’t know why, but this information is hard to find in the docs.

Anyway, the severity and priority for alerts is mapped like this (works the same way in SCE):

Severity

  • Critical = 2
  • Warning = 1
  • Information = 0

Priority

  • High = 2
  • Medium = 1
  • Low = 0

MaintMode on a single class

Didnt know that this would work…

In a project that I’m working on the customer wanted me to create a Management Pack for a couple of services, the only problem was that they wanted to restart the services during the night.
My first solution was to create a group with the computer in it and run a PowerShell script to set the computer in to maintenance mode.

Then I tested to put my own class in that group and use the same script on the class instead.

Worked like a charm :-)

The script: systemcenterforum.org/maintenance-mode-scheduled-task-for-ops-mgr-2007/

Maintenance Mode


Collection of non catalogue MPs

Ian Blyth have a nice collection of non catalogue MPs, ie MPs that’s not in the Microsoft Management Pack Catalogue

The catalogue can be found at http://ianblythmanagement.wordpress.com/mps/


Next Page »