You must be logged in and have permission to create or edit a blog.
|
|
|
Author:
|
|
Created:
|
Tuesday, September 09, 2008 2:24:59 PM
|
|
|
Everything about Microsoft Windows Operating Systems, Server Products, Programming and Technologies
|
By Stefan Koell on
Tuesday, November 04, 2008 4:46:59 PM
... but those who are may have received a conference guide like this:  How do you spell connect? Thanks to David Allen for this.
|
By Stefan Koell on
Thursday, September 25, 2008 12:05:05 PM
|
By Stefan Koell on
Thursday, February 28, 2008 7:35:37 AM
CheckServiceState Script CheckServiceState Script If you ever wanted more control how to monitor windows services with Operations Manager 2007 you most likely realized, that you have to do it all by yourself with a custom script. I had at least two major problems which forced me to use a custom script: - It seems that you cannot monitor the status of a service which has the startup type set to "Manual". (There is a parameter in the overrides dialog called "Alert only if service startup type is automatic" but it doesn't have any effect, the health state simply doesn't change)
- When using templates to monitor a windows service you cannot override the monitor to only monitor a subset of services using a group. The group just doesn't show up in the list
So this is my approach to windows service monitoring: First of all, let's set up a Windows Service monitoring using the standard Management Pack Templates Wizard. In this example: "Print Spooler". In the monitoring wizard select or create a destination management pack, here: "Windows Service Monitoring". I use the template wizard because I can use the discovered service class to target my own script and I get all the other goodies (performance monitors, baseline rules, etc). After a while the service you just configured to monitor will be discovered. Now let's setup a group: Create a new group with a name like "Print Spooler Service Group" in the "Windows Service Monitoring" management pack. In this example I use explicit group members but you can also use dynamic membership of course. The beauty is, that your group can (and should) contain the discovered service instances:
 Next, bring up the monitors the template wizard creates for us:
 There you should see the (very inflexible and buggy) availability monitor: Right-click on the "Service Running State" monitor and select "Overrides > Override the Monitor > For all objects of type: Print Spooler". In the Override Properties, disable the monitor (check "Override" for the Parameter Name "Enabled" and change the "Override Setting" to "False"). Next, right-click on the "Availability" node and select "Create a monitor > Unit Monitor...". In the unit monitor dialog, select the "Scripting > Generic > Timed Script Two State Monitor" as monitor type and place it in the same Management Pack "Windows Service Monitoring". In the General properties page we can now target the script to the "Print Spooler" class. Also be sure to disable the monitor by default (We enable it later using a group override).
 Pick a schedule which makes sense to you (I recommend every 5 minutes but depending on your environment I suggest that you don't go below 2 minutes). In the Script page, provide a script name, like CheckServiceState.vbs and paste the attached script into the script area. The script takes 3 parameters (documented in the script) but for a standard scenario you can just use: "$Target/Property[Type="MicrosoftSystemCenterNTServiceLibrary!Microsoft.SystemCenter.NTService"]/DisplayName$" "Running" "Auto" Because we already target the print spooler class we can use a dynamic parameter to pass on the service name. Parameter 2 and 3 (which is optional) can be used to define the desired status and startup type. Please be sure to encapsulate each parameter in double-quotes - just to be on the safe side. Next let's define the health expressions:
 And finally the alert:
 I suggest an alert description like: The state of the monitored service '$Target/Property[Type="MicrosoftSystemCenterNTServiceLibrary!Microsoft.SystemCenter.NTService"]/DisplayName$' on '$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$' is invalid: $Data/Context/Property[@Name='AlertText']$
After you created your monitor, enable it using an override for the group we created earlier. As last (optional) step I suggest to create a state view containing the Print Spooler instances and scoped to the group where we enabled the monitor.
 Of course, it would be much better if that functionality and flexibility is provided by OpsMgr out of the box... cheers
|
By Stefan Koell on
Tuesday, December 18, 2007 3:00:37 AM
Once again, a little post to share with you guys about Operations Manager Tasks - this time using Powershell. First a little background story: Current version of Operations Manager 2007 (SP1RC) has still some nasty bugs and it seems that especially the events view doesn't get much attention from the product team. The event view doesn't HTML-Encode the event description in the details pane. Which is bad if you have to look at events (published exceptions for example) with fragments of XML or HTML included. This information just doesn't appear in the preview pane. So, the first thing which came to my mind is: Ok, then. How about some kind of console task which executes a quick Powershell command to dump out the event details using the Get-Event Cmd-Let. Next Problem: You can create an event task and put a dynamic parameter $ID$ in it. However, starting the task using the actions pane on the right always passes the same ID (I guess the ID from the first event selected when the view gets loaded) to the task - regardless which event was selected! Lucky me, there is a workaround: When you execute the task using the Actions menu in the console, the task will always get the ID from the selected event. So, now the interesting stuff: How to setup such a task? - First create a console task for events using the authoring section in the console.
- When defining the command, set the application to: C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe
- Set the parameter to: -PSConsoleFile Microsoft.EnterpriseManagement.OperationsManager.ClientShell.Console.psc1 -NoExit .\Microsoft.EnterpriseManagement.OperationsManager.ClientShell.Startup.ps1;Get-Event -Id $ID$
- Set the working directory to: C:\Program Files\System Center Operations Manager 2007
- Finally, uncheck the "Display output when the task is run" checkbox
That's it. Enjoy...
|
By Stefan Koell on
Wednesday, September 19, 2007 2:43:37 AM
In MOM 2005 it was easy to notify someone on specific alerts. SCOM 2007 - with it's subscription based system - cannot handle these kind of notifications. But the limitation is the user interface. Jakub from the SCOM 2007 product team released some very useful code which helped to implement a notification based on the alert name. One problem of Jakubs code is, that it's a C# program which is not very handy and that he creates most of the stuff in code which can be created with the UI. I translated the script to power shell, which should be much friendlier to use, deploy and let's you quickly tweak some settings. The code below works for me (at least working with email notifications), but I have to admit, I didn't test it that much. The script usage is pretty simple, but you have to do some stuff first: - Setup email notification
- Create at least one recipient
- The alert has to be raised at least once
- Change the $RMS variable in the script to your root management server
Then, just execute it in Power Shell: ".C:\Set-NotificationForAlert.ps1 "This is a test alert" "This is a test notification recipient" Parameter 1: The name of the alert Parameter 2: The name of the recipient So, hopefully I can ease some pain with this... Set-NotificationForAlert.ps1
|
By Stefan Koell on
Thursday, May 03, 2007 6:08:37 AM
Someone might ask: why the heck do I need that? And yes, I never thought that I will need it but I learned that in SCOM 2007 a group is not always a group. Jakub Oleksy helped me to understand and solve my problem and I am happy to share this information with you. The problem is, that groups created by the web application wizard can not be tweaked using the UI in SCOM 2007. It's not possible to create a dynamic membership rule. It's also not possible to assign a subgroup to such a group. So having a lot of servers and a lot of web applications it's not really fun to pick every single server in every single web application. Here my workaround: - Create a web application using the wizard
A group named after your web application with the suffix "watcher computers group" will be created - Create your own computer group using the UI and define a dynamic membership rule
- Configure the script (the 3 lines at the beginning) and test (DO NOT RUN THIS UNTESTED IN PRODUCTION ENVIRONMENT!)
This is just a proof-of-concept script to show how you can do stuff like this. According to Jakub there may be a fix in SP1 which enables you to utilize the group created by the web application wizard in a way to either create a dynamic membership rule or attaching a subgroup, or both. Disclaimer: USE THIS AT YOUR OWN RISK. I AM NOT RESPONSIBLE FOR ANY DAMAGE THIS SCRIPT MAY CAUSE. THAT SAID, HAVE FUN! Source Code
|
By Stefan Koell on
Tuesday, April 24, 2007 11:08:37 AM
During the deployment of System Center Operations Manager 2007 we realized that the database is not supported on Itanium (IA64) hardware. This was a big issue for us, because we only had IA64 hardware for our database machines. So a sick idea came to our minds: just install it on a temporary x86 or x64 machine - with the exact same machine name as the final IA64 production machine, detach the database and move it to the IA64 and re-attach it there. After that, you have to ensure that the broker function is enabled on the DB. To do so, execute the following query in the SQL management studio (assuming you named the database 'OperationsManager': SELECT is_broker_enabled FROM sys.databases WHERE name='OperationsManager' This should return '1'. If not fire up the following statement (again, assuming the database is named 'OperationsManager': ALTER DATABASE OperationsManager SET ENABLE_BROKER If the service broker is not enabled you might get errors or hangs during discoveries and submitting tasks. So far this is working great for us, it's still not clear if a setup like this is supported by Microsoft. But there really should be no difference running the DB on a IA64 instead of running it on a x64. No binaries are installed by the setup, only the database schema is created. As far as I know, Microsoft is working on IA64 support for the database - maybe a Service Pack 1 thing... Update: You also have to be sure that the CLR (.NET Common Language Runtime) for stored procedures is enabled. To do so: EXEC sp_configure 'clr enabled', 1; RECONFIGURE WITH OVERRIDE; GO
|
By Stefan Koell on
Friday, March 23, 2007 3:55:37 PM
James Henry blogged about how to enable PDF indexing in Sharepoint: Here are best instructions for properly configuring SharePoint to search PDF documents and view the file type icon in a document library. This involves installing the Adobe PDF IFilter 6.0 on each SharePoint 2007 front end web server. You would also need to do this on the Search Server, if you have split this up in your environment. Perform the following steps for either Windows SharePoint Services v3 (WSS v3) and Microsoft SharePoint Server 2007 (MOSS 2007). - Download Adobe PDF IFilter 6.0
- Stop the IIS Admin service: Start -> Run -> services.msc -> IIS Admin Service -> Stop
- Run the Adobe PDF IFilter 6.0 Setup program to install the filter on the server
- Copy the ICPDF.GIF file (
– right click and save as) to "[Hard_Drive]:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\Template\Images" - Edit the file "[Hard_Drive]:\Program Files\Common Files\Microsoft Shared\Web server extensions\12\Template\Xml\DOCICON.XML"
- Add an entry for the .pdf extension.
- Perform an iisreset by performing the following: Start -> Run -> iisreset. You could also recycle the SharePoint Application Pools in Internet Information Services Manager
For MOSS 2007, perform the following additional steps - If you have MOSS 2007 and have enabled Shared Services then, goto Central Administration -> Shared Services Administration -> Select your current Shared Services Provider -> Search -> Search Settings -> File types
- Click on the "New File Type" button
- Add the "pdf" file extension in the designated text box and click on the "OK" button
- Go back to the Search Settings page
- Click on the "Content sources and crawl schedules" link
- Select the content source, access its context menu, and click on "Start Full Crawl"
I use Sharepoint Services V3 and installed the PDF IFilter after I uploaded hundreds of PDFs. This was bad, because Sharepoint Services does not crawl these already uploaded documents until they are touched (modify a property or so). Since no GUI is available to do so like in MOSS you have to use stsadm.exe command which ships with sharepoint: Change the directory to: Program Files\Common Files\Microsoft Shared\web server extensions\12\bin Now execute: stsadm.exe -o spsearch -action fullcrawlstop then: stsadm.exe –o spsearch -action fullcrawlstart
|
By Stefan Koell on
Friday, March 23, 2007 2:55:37 PM
Some time ago I implemented (actually still implementing and enhancing) MOM 2005 to monitor and manage a lot of servers (>600). Some MOM Basics: A nice feature in MOM is the ability to start tasks in the Operator Console. When you create a task you can specify variables in the command line. The most common variable is $Computer Name$ or $TargetComputer$. Using this placeholder you are able to dynamically fill in the computer name from the console selection in the command line. Because alerts and events are always related to a computer, you can start tasks from these views as well. You can define local or remote tasks. For now we are just focusing on local tasks, which are command lines (scripts are not possible) executed on the machine running the Operator Console. Some Remote Desktop Basics: How to find out who has remote desktop connections to a server? You have more than one choice to find out who is currently connected. One of course is Royal TS if the security context allows it, another is the Terminal Services Manager from the Administrative Tools (you may have to install the adminpak.msi first), the fastest way is to fire up a command prompt and type: query session /server:[servername] As you can see, the query session command lists all users connected. Next to the user name you see the session id. So if you really need to get on that box you may want to kick out one of the users: reset session 1 /server:web01 The command above kills the connection with the session id 1 from the user “Admin”. Note: if this user is still connected or has any opened documents, it’s all gone… Some Command Shell Basics: I wanted to have some sort of batch file which shows me all sessions, asks me if I want to kill one and kills the session id I entered. This batch file should look something like this: Here a short description of the code: The command line parameter %1 will be stored in the environment variable %ComputerName%. Query session will be exectued. SET /P asks for user input and stores it in the environment variable %uinp%. Reset session will be executed with the session id the user provided in the line before. Clear the screen and show again the sessions to verify it worked. So I place the batch file in C:\batchfiles\resetsession.cmd on the machine(s) where the Operator Console is running and create a task with the command line: C:\batchfiles\resetsession.cmd $Computer Name$ All set. Except: I don’t really want to deploy batch files to all machines running Operator Console. So what can be done here? There is a very useful feature in the command shell: executing multiple commands in one line. You can use “&”, “&&” and “||” to combine multiple commands. For example: command1&command2 will execute command2 after command1 completed. command1&&command2 will execute command2 after command1 completed successfully (ERRORLEVEL=0) command1||command2 will execute command2 when command1 was unsuccessful (ERRORLEVEL<>0) CMD /V:ON /C "QUERY session /server:$TargetComputer$&SET /P uinp=Enter Session ID to reset and press [ENTER]:&RESET session !uinp! /server:$TargetComputer$&CLS&ECHO Session reset command executed.&QUERY session /server:$TargetComputer$&PAUSE" One thing to mention here is the parameter /V:ON and the different handling of the environment variable %uinp%. /V:ON allows to expand a variable at execution time but then you have to use “!” instead of “%”. Instead of deploying batch files you can do more complex things in one command line. Paste this into the task command line and you are all set. Have fun.
|
By Stefan Koell on
Thursday, March 22, 2007 2:55:37 PM
[Win]+[Space] opens the Vista Sidebar [Win]+[T] goes through all task bar programs and shows you the mini preview [CTRL] holding the CTRL key while scrolling the mouse wheel changes the icon view in Explorer windows [ALT] use ALT to show the classic menu bars in IE7 and Explorer [SHIFT] hold SHIFT and right-click to get the context menu items “Open Command Window here” and “Copy as Path” on files and folders [Win]+[D] show Desktop [Win]+[E] open Windows Explorer [Win]+[R] opens the Run dialog [Win]+[Q] opens Messenger or Office Communicator [Win]+[F] opens Search dialog [Win]+[G] sets focus to Windows Sidebar, after pressing the combination again you can toggle through the Sidebar Gadgets [Win]+[L] lock your Desktop [Win]+[M] minimize all windows [Shift]+[Win]+[M] opens all minimized windows [Win]+[X] opens the Windows Mobility Center [Win]+ [Pause] opens the Systemproperties window
|
|
|
|
|
|