Wednesday, May 02, 2012

Using Papercut to test SCOM subscriptions

Have you ever needed to test a subscription in SCOM using the email channel, but don't access to a SMTP server and/or don't want the emails being sent out to the subscriber? I’ve run into this when testing out subscription criteria to ensure I've made the right selections. Since my SCOM development environment runs on Hyper-V and doesn't have access to the Internet my only option is to install an SMTP server, right? Not necessarily, a much easier solution is Papercut.

Papercut is a free simplified SMTP server. Here’s how to use it.

1. First, download the Papercut zip file from Codeplex.
2. Then, unzip the download to a location on your SCOM server. Quick tip, this will be your Root Management Server in SCOM 2007.
3. Inside the unzipped folder you'll see 3 files. Launch Papercut.exe and click options.clip_image002
4. In the options dialog, you can select the IP and Port that you want the SMTP server to listen on. I'll leave it on "Any", so that it will listen for SMTP traffic on the designated port for any of the IP's in the list. Check "Minimize automatically" if you want the application to always minimize when launched.
 image
5. In SCOM you need to setup an SMTP channel. Launch the SCOM console and navigate to the Administration pane, then Notification -> Channels. Right-click channels, then click New--> E-Mail (SMTP).
6. Enter a channel name and description.
clip_image006
7. Click Add and enter "localhost". Set the port number to whatever port you chose when you setup Papercut and click OK.
clip_image008
8. Enter a return address and click Next.
clip_image010
9. Setup your format as you like and click Finish.
10. All that's left is setting up a subscription that uses the new channel you just created. After that you can generate an alert in SCOM that matches your subscription criteria and it will appear in the Papercut window. Here's an example.
clip_image012


Another cool features is that Papercut retains all of the emails as .eml files in the folder that Papercut.exe runs from. So there you go, a very simple way to test SCOM subscriptions using the SMTP channel without all the work of setting up your own SMTP server.

Tuesday, April 12, 2011

Discovery and the Dell Windows Server MP for SCOM

Yesterday, I imported the Dell Server MP for SCOM (v4.1).  My best practice is to first test the MP in a development environment.  Once I have some run time on the MP and feel comfortable importing the MP into production, I create an override to disable the MP’s object discovery and I store the override in an overrides MP specific to the parent MP (ex. “Dell Windows Server (Scalable Edition)_OVERRIDES”).  This ensures that when I import the Dell MP and the overrides MP into our production environment discovery will not automatically be run on all of our production Windows servers.  This method allows me to more casually deploy the MP into our production environment, by creating additional overrides targets at a group of Windows servers or specific Windows servers.  Much safer than the spray and pray approach. 

If you want to do the same, you need to create an override to disable the object discovery named “Dell Server Discovery”.  This object discovery is targeted at Windows Computer.  Make sure you import the Dell MP and the MP containing your overrides into your production environment at the same time.  Ifyou don’t, you may not get the override created quickly enough to prevent the discovery from running on all of your Windows servers.

Example:
image

Once I am confident the Dell MP is not generating numerous false positives, script errors, etc., I will remove the override above to enable the discovery to run against all of our Windows servers.

I’ll follow-up at a later date with my impressions of the Dell MP (v4.1).

Thursday, August 26, 2010

SCCM Advertised Programs Don’t Appear on Windows 2008 Server RDP Sessions

Earlier today, I came across a strange issue that arises when advertising a program to Windows Server 2008 using SCCM.  The program advertisement appeared correctly on my Windows 2003 servers remote desktop console/admin session, but the same could not said when logging on to my Windows 2008 servers.  Instead, all I saw was as a message stating “No programs are available to run from a Terminal Services session”.
image

I logged off, launched the remote desktop admin session with “mstsc.exe /admin”, but still the problem existed.  Finally, after a small amount of troubleshooting I discovered why this issue was occurring.  In Windows 2008, unlike Windows 2003, there is no longer a session id 0.  Instead, for SCCM at least, the first user that logs on will be the only user able to see what is available via Run Advertised Programs or the “Install a program from the network” section in Add/Remove programs.  On both servers that I was logging in to, there were already Remote Desktop sessions as seen below:
image[9]

In the screencap above, I’m the 2nd user with ID 3.  Notice there is no ID 0 as you would see when logging on to a Windows 2003 Server with “mstsc.exe /admin”.  As soon as I had the user with Session ID 1 log off, here’s what I saw.

image

Notice that I still have the same session ID, but now the advertised program that I expected appears.

For a better understanding of why Session 0 is no longer needed in Windows 2008 take a look at KB947723.

Thursday, August 19, 2010

Windows Live Essentials 2011 beta refresh

Read more about it here.  Here’s to hoping they fixed the account lockout issue present with Live Sync.

UPDATE:  I haven’t confirmed this myself, but comments on the Windows Team Blog indicate that the account lock-out issue still exists for Live Sync users on domain PCs.  Guess, I’ll refrain from installing Sync for now. 

Wednesday, August 18, 2010

Automating SQL 2005/2008 Express Backup in 5 Easy Steps

I was recently asked to backup all system and user databases on a SQL 2005 Express installation. Unfortunately, SQL 2005 Express native backup capabilities are not on par with SQL 2005 Standard/Enterprise. SQL Express includes functionality for backing up a single DB using SQL Server Management Studio Express, but this is only ideal for backing up a single database and it cannot be scheduled. So here are the steps for automating this process.  If you’d like more detailed information, check out this much more thorough article at http://www.sqldbatips.com/showarticle.asp?ID=27.

Step 1:

Save the lines here in a file called expressmaint.sql to C:\SQLScripts.

Step 2:

Open an administrator command prompt to “c:\SQLScripts\” and run “sqlcmd -S .\SQLExpress -i c:\sqlscripts\expressmaint.sql”.

image

Step 3:

Save the lines below in a file called sqlbackup.sql and save it in C:\SQLScripts.  Be sure to change the variable contents for @reportfldr to whatever is appropriate for your environment.

exec expressmaint
   @database      = '$(DB)',
   @optype        = 'DB',
   @backupfldr    = '$(BACKUPFOLDER)',
   @reportfldr    = 'c:\SQLScripts',
   @verify        = 1,
   @dbretainunit  = '$(DBRETAINUNIT)',
   @dbretainval   = '$(DBRETAINVAL)',
   @rptretainunit = 'copies',
   @rptretainval  = 2,
   @report        = 1

Step 4:

Save the lines below in a file called sqlbackup.cmd and save it in C:\SQLScripts.  Be sure to change “.\SQLExpress” to the name of your SQL Express server and instance” and don’t forget to change the BACKUPFOLDER location to whatever is relevant in your environment.  NOTE: Each “sqlcmd” begins a new line.

sqlcmd -S .\SQLExpress -i"c:\SQLScripts\sqlbackup.sql" -v DB="ALL_USER" -v BACKUPFOLDER="e:\SQLBackups" -v DBRETAINUNIT="days" -v DBRETAINVAL="1"

sqlcmd -S .\SQLExpress -i"c:\SQLScripts\sqlbackup.sql" -v DB="ALL_SYSTEM" -v BACKUPFOLDER="e:\SQLBackups" -v DBRETAINUNIT="days" -v DBRETAINVAL="1"

If you were to run the 2nd sqlcmd above your output would be similar to this:

image

Step 5:

Create a scheduled task to run “C:\SQLScripts\sqlbackup.cmd” at your desired backup frequency.

Friday, August 06, 2010

Windows System State Analyzer

“The basic functionality of the System State Analyzer tool is to allow you to compare two snapshots taken at different points in time. This allows you to compare the state of a machine both before and after an application install for instance.”  Read more here.

Killing a hung service

Today I came across a system that was failing to heartbeat .  Opening services.msc on the box revealed that the System Center Management service status was “Starting”.   Stopping the service from services.msc didn’t work, so I had to resort to a more forceful option.

Here’s how I did it.

  1. Open a command prompt
  2. Query for the state and PID by entering “sc queryex healthservice”
    image
  3. Now that we have the PID, we can use the Taskkill command by running “Taskkill /PID /1168 /F.  The /F switch will forcefully terminate our process.  
    image

Now you can start the HealthService.

Monday, November 23, 2009

Adding SCOM R2 Report Models

SCOM R2 includes 2 new report models for Events and Performance.  For direction on how to add these models have a look at http://blogs.technet.com/momteam/attachment/3222196.ashx

Technorati Tags: