MEMOEXP

Our System Center Memo

SCSM Incident Auto Close Guide

Having a request from the customer to automatically close an incident that has been resolved for a period of time is very common. But how do we do that in Service Manager? I’ll show you a step by step with screenshots here.

Before I begin, take note that I did not write this script. The solution came from Marcel Zehner, and I simply shorten the script for my own needs. I also felt that there was a need to have a step by step with screenshot guide. To view the original, go to his blog here. He has many other useful solutions as well which will benefit you.

Ok for starters, you will need to download the SMLets Powershell Module. After download, extract and copy the SMLets folder, and paste it in %\Windows\System32\WindowsPowerShell\v1.0\Modules.

 

1. Launch the Authoring Manager. Under File, click New. Specify a location and a name for your Management Pack, click Save.

image

 

2. Under Management Pack Explorer, right click on Workflow, click Create.

image

 

3. Key in a Name and Description if needed. You cannot have spacings in the Name. Click Advanced if you want to change the retry interval should the workflow fail, or specify the maximum time the workflow is allowed to run. Click Next.

image

 

4. We’d like the workflow to run on a specific time, so I’m going to select the first option. Click Next.

image

 

5. I want the workflow to run on every midnight, so my configuration is as below. If you’re testing the workflow, maybe set it to run every 5 minutes. Click Next.

image

 

6. Confirm the Summary, click Create.

image

 

7. Click Close.

image

 

8. You should be seeing this screen now. On the Activities Toolbox, look for Windows PowerShell Script, and drag it to the workflow, and drop it in the middle.

image

 

9. You will then see this screen. On the Details pane, look for Script Body. There will be a red exclamation mark. Click the blank field beside it and a button will appear, click it and another screen will appear.

image

 

10. In the Script Body page, key in exactly this. This script will close all Incident tickets that has been resolved and has not been updated in the last 5 days.

$Date = (get-date);
$DateString = $Date.toString();

import-module smlets;

$5DaysOld = (get-date).addhours(-120);

$IncidentsToClose = Get-SCSMObject -Class (Get-SCSMClass -Name System.WorkItem.Incident$) | where{$_.lastmodified -lt $5DaysOld -AND $_.Status -like "*Resol*"};

$IncidentsToClose | Set-SCSMObject -property Status -Value Closed;

image

Under Script Properties, leave everything blank. Click Ok.

image

Note! If you’re doing testing, you might not want to wait for 5 days. So you can replace

$5DaysOld = (get-date).addhours(-120); with $5DaysOld = (get-date).addminutes(-1);

This will then close all tickets that has been resolved for 1 minute.

 

Note! This script will only work with SMLets Beta 3. The Beta 2 script is a little different and I’ve already updated this guide to cater to Beta 3’s script. If you’re looking for the Beta 2 script, I’ll actually suggest you to upgrade your SMLets to Beta 3 and use this script instead.

 

11. The next step is to save your Management Pack. If you get this error when saving, go back to the Script Body, check all the “ and – again. Since you’re copying from the web, the “ and – might not be recognizable, just delete and retype the special characters.

image

 

12. After saving the Management Pack, open the folder that you saved the MP. You’ll see 5 files. Only 2 are needed. First, copy the DLL file and paste it into %Program Files\Microsoft System Center\Service Manager 2010

image

 

13. Next, open your SCSM Console, go to Administration, right click Management Packs and click on Import.

image

 

14. Browse to the same folder that you saved the Management Pack, and select the XML file.

image

 

15. Click Import, then Ok.

image

 

16. You’re done. To see if the workflow actually ran, go to Administration > Workflow > Status. Look for the workflow you just created, and check the logs.

March 31, 2011 Posted by | System Center Service Manager (SCSM) | 12 Comments

Changing SCSM Portal Address

Ever have a customer request that they want the Self Service Portal to be a specific address, different from the one you’ve initially setup? Well, its not possible to change the URL. However what you can do is set up a CNAME in your DNS to accomplish this goal. Here is how to do it.

 

1. Go to the DC. Open up DNS under Administrative Tools. Under the DC, expand Forward Lookup Zones, then right click the folder with the domain name, select New Alias (CNAME).

image

 

2. Under Alias Name, type in the portal URL that you want. Then under target host, drill down and browse to your portal host name, which in my case is SCSM. Click Ok.

image

 

3. Go to the server which the Portal is installed. Launch IIS Manager, go to the Portal Sites, in my case, SCSMPortal, click on Bindings on the right panel.

image

 

4. Click Add.

image

 

5. Select Type as https, IP address as All Unassigned, Port as 443. Then select the SSL certificate. Click Ok.

image

 

6. While highlighting your portal on the left pane, in my case SCSMPortal, Double click HTTP Redirect.

Note! HTTP Redirect is not installed by default for IIS7. To install it, go to Server Manager > Roles > Web Server (IIS), look for Add Role Services, you’ll find that you will have the option to install HTTP Redirection.

image

 

7. Check Redirect requests to this destination. Key in the full address of the Portal Site, click Apply on the right pane. If you’re not sure, its https:// + Full Computer Name + /enduser. So for my case it is https://scsm.systemcenter.local/enduser

(To get your Full Computer Name, Right click My Computer > Properties. You’ll see it there.)

image

 

8. Browse to the new URL which in my case is https://servicemanager, the portal should launch without problems.

 

P/s If you’re getting password prompts when using the new URL, then highlight the portal on the left pane, and double click on Authentication. Select Basic Authentication and click on Enable on the right pane. Try using the new URL again, you shouldn’t get any prompts now.

image

March 30, 2011 Posted by | System Center Service Manager (SCSM) | 2 Comments

Install SCCM

This is a step by step installation guide for SCCM I made in hopes that it will help anyone in need. Before proceeding, make sure you’ve installed and configured all the necessary. Refer to the links below if you’re unsure. There are 2 SQL links, pick 1 only.

Installing SQL 2005 Standard, Installing SQL 2008 R2, Configuring SCCM Prerequisites.

Launch the SCCM installer.

1. Click Configuration Manager 2007 SP2.

image

 

2. Click Next.

image

 

3. Select Install a Configuration Manager site server, click Next.

image

 

4. Check the license agreement, click Next.

image

 

5. Select Custom settings, click Next.

image

 

6. Select Primary Site, click Next.

image

 

7. Select No. I do not want to partificate right now, click Next.

image

 

8. Click Next.

image

 

9. Click Next.

image

 

10. Key in a 3 digit Site code and a Site name.

image

 

11. Select Configuration Manager Mixed Mode, click Next.

image

 

12. Click Next.

image

 

13. Click Next.

image

 

14. Leave the defaults, click Next.

image

 

15. Leave the defaults, click Next.

image

 

16. Click Next.

image

 

17. Select The latest updates have already been downloaded to an alternate path, click Next. If you do not have the SP2 files, select Check for updates and download newer versions to an alternate path.

image

 

18. Browse to the files, click Next.

image

 

19. Click Next.

image

 

20. After the Prerequisite Check, click Begin Install. If there are errors please make sure you’ve installed all the prerequisites and configured all the required settings properly.

image

 

21. After installation is complete, click Next.

image

 

22. Click Finish. You’ve successfully installed System Center Configuration Manager 2007 SP2.

image

March 13, 2011 Posted by | System Center Configuration Manager (SCCM) | Leave a comment

Installing SQL 2005 Standard

Before installing SCCM, you will need to install SQL. I’ll walk you through with screenshots below. Guides to other installation as below.

Install SQL 2008 R2, Configuring SCCM Prerequisites, Install SCCM.

Launch the SQL Installer.

1. Click Server Components, tools, Books Online, and samples under Install.

image

If below appears, click Run program.

image

 

2. Check the license agreement, click Next.

image

 

3. Click Install.

image

 

4. Click Next.

image

 

5. Click Next.

image

 

6. There will be a warning on ASP .Net Version Registration Requirement if you’re running on a 64bit OS, but installation can still proceed. Click Next.

image

 

7. Click Next.

image

 

8. Check SQL Server Database Services, click Next.

image

Optional step. From Advanced, I expended Client Components and chose Management Tools and Business Intelligence Development Studio but this is not mandatory.

image

 

9. Click Next.

image

 

10. Select Use the built-in System account, and select Local system on the drop down. Also check SQL Server Agent. Click Next.

image

 

11. Select Windows Authentication Mode, click Next.

image

 

12. Select SQL collations (used for compatibility with previous versions of SQL Server), then select Dictionary order, case-insensitive, for use with 1252 Character Set. Click Next.

image

 

13. Click Next.

image

 

14. Click Install.

image

If below screen appears, click Run Program.

image

 

15. Click Next.

image

 

16. Click Finish.

image

 

Installing SQL 2005 Standard SP3

You are required to update your SQL 2005 to SP3. Unfortunately my screen shots are gone so you’ll have to try this yourself. Its straightforward but if you bump into any questions just post a comment here.

NOTE! SQL2005 Standard SP3 is a cumulative update, you are not required to install the previous service packs.

March 13, 2011 Posted by | System Center Configuration Manager (SCCM) | Leave a comment

Installing SQL 2008 R2

Before installing SCCM, you will need to install SQL. I’ll walk you through with screenshots below. If you choose to install SQL 2005 Standard instead, check out the link below, along with other useful links.

Installing SQL 2005 Standard, Configuring SCCM Prerequisites, Install SCCM.

Launch the SQL Installer.

1. Go to Installation on the left bar, and click New installation or add feature to an existing installation.

image

 

2. After pre-requisite check is completed, click Ok.

image

 

3. Click Next.

image

 

4. Check I accept the license terms. Click Next.

image

 

5. Click Install.

image

 

6. Click Next.

image

 

7. Select SQL Server Feature Installation. Click Next.

image

 

8. Click Next.

image

 

9. Click Next.

image

 

10. Click Next.

image

 

11. Click Next.

image

 

12. Key in an administrator account. Click Next.

image

 

13. Select Windows authentication mode, key in an administrator account. Click Next.

image

 

14. Select Install the native mode default configuration.

image

 

15. Click Next.

image

 

16. Click Next.

image

 

17. Click Install.

image

 

18. After installation, click Close.

image

March 13, 2011 Posted by | System Center Configuration Manager (SCCM) | Leave a comment