Feb 23, 2011

SMS Site Component Manager failed to reinstall this component on this site system

Компонент SMS_SITE_SQL_BACKUP может ежечасно сыпать ошибкой ID 1020:
SMS Site Component Manager failed to reinstall this component on this site system.
Solution: Review the previous status messages to determine the exact reason for the failure. SMS Site Component Manager will automatically retry the reinstallation in 60 minutes. To force SMS Site Component Manager to immediately retry the reinstallation, stop and restart SMS Site Component Manager using the SMS Service Manager.

Решение было найдено здесь.
В папке с установленным SCCM 2007 (по умолчанию это C:\Program Files (x86)\Microsoft Configuration Manager\) находим файл install.map, открываем его блокнотом и ищем следующие строки:


BEGIN_COMPONENT_FILELIST
   
    <1193>
    BEGIN_DIRECTORY
       
        <9><>
        FILE <1><значение>
        END_DIRECTORY

 и меняем на
BEGIN_COMPONENT_FILELIST
   
    <1193>
    BEGIN_DIRECTORY
       
        <9><>
        FILE <1><значение>
    FILE <0><вес файла>
    END_DIRECTORY

где вес файла - объём файла srvboot.exe. Объём файла может отличаться от версии SCCM к версии. У меня SP2 R3, поэтому файл весит 333664:


Перезупаскаем службу SMS_SITE_COMPONENT_MANAGER, после чего ошибка пропадает:

Installing Opalis 6.3

Useful Resources:

Opalis Blog – http://blogs.technet.com/b/opalis/p/opalis_resources.aspx
Technet – http://technet.microsoft.com/en-gb/library/ff630946.aspx
Charles Joy – video on installing Opalis – http://blogs.technet.com/b/charlesjoy/archive/2011/01/07/installing-opalis-integration-server-6-3-video-tutorial.aspx
My Test System

Windows 2008 x64 with .Net Framework 3.5
SQL 2008 with SP1
Overview

  1. Make sure account doing the install has local windows administrator rights on the Opalis Integration Server and SQL permissions to create the Opalis database
  2. Create a domain user account and make it a local windows administrator on the Opalis server. Also, make sure it has the log on as a service right. I have found that the installer doesn’t always seem to assign this right automatically.
  3. Download the evaluation of Opalis and extract the download – you’ll find 3 folders which are also zipped. Unzip these as well.
  4. If you have 6.2.2 then you’ll need to run the SP1 upgrade. I’ll assume here that we are doing a clean install.
  5. While we are here, we should extract the licenses document – this is a word doc that contains the licenses for Opalis. We’ll need to copy and paste these into the install wizard later.
  6. Install 6.2.2.
  7. Download console files
  8. Deploy console 


Install the Opalis Integration Server

  1. Install Management Server
  2. Run Setup from the extracted 6.22_6.2.2.5229 folder
  3. Choose Install Opalis Integration Server
  4. Choose Install the Management Server
  5. Run through the Management Server wizard
  6. Accept the license
  7. Enter User Information

  8. Choose Destination Folder
  9. Enter Service Account Information
  10. Click Next to install
  11. Click Finish to complete
  12. Configure the Data Store
  13. Choose Configure the Data Store
  14. Choose SQL Server Database
  15. Type in the name of the SQL Server that will host the Opalis database
  16. Create a new database and click Finish
  17. Hopefully you’ll see this ;-)
  18. Import Licenses
  19. Choose Import a License
  20. The next stage isn’t the most intuitive. You need the license key from the Opalis Eval Product Licenses.docx (remember to include the {} brackets). And you’ll also to browse to the license file – OpalisIntegrationServer_180DAY_EVAL.lic – once this is done, you should see this. Click Close
  21. We’ll import the Integration Packs Later.
  22. Exit the installer
At this stage click EXIT – we do not want to install the client.


Run the Foundation Objects installer

  1. Extract the Opalis 6.3 folder and then browse to the Opalis Integration Server. You’ll see 3 files here.
  2. Open the Management Server installation folder on the Opalis Server. By default, this is located in System Drive: Program Files\Opalis Software\Opalis Integration Server\Management Service. Browse to the Components\Objects folder.
  3. Copy the OpalisIntegrationServer_FoundationObjects.msi file provided from the download (step 1) to the System Drive:\Program Files (x86)\Opalis Software\Opalis Integration Server\Management Service\Components\Objects directory. Replace the existing file.
  4. Run the OpalisIntegrationServer_ManagementService_630_PATCH.msp installer.
Deploy an Action Server

  1. Click Run, click Programs, click Opalis Software, click Opalis Integration Server, and then click Deployment Manager. Deploy the action servers and clients.
  2. Right click Action Servers and choose Deploy New Action Server
  3. Enter the Action Server Account details. Make sure this account has database owner rights on the Opalis database.
  4. Select any integration packs you want to deploy (we won’t have any listed as we haven’t imported them yet).
  5. Confirm the information and click Finish
  6. The installation can take a few minutes – great opportunity for a coffee break!
Deploy Client

  1. In the Deployment Manager console, right click Clients and deploy new client.
  2. State the computers onto which you want to deploy the client.
  3. State any Integration Packs you want to deploy and then click Finish.
  4. Run the client patch from:


That is core product installed. Future instalments will cover:
  • Deploying the Operator Console
  • Importing Integration Packs
  • Creating Workflows

Feb 18, 2011

Removing a retired DP from all your packages

When you remove an SMS 2003 Distribution Point (DP) from a site, and existing packages have been distributed to this DP, those packages may not be removed.  If you look at that package in the admin console you will notice that the the type has changed from "Server" to "Unknown".  The Package Status will also show a type of nothing instead of "Server".
To properly remove these you can use the Manage Distribution Points Wizard to uncheck the DP before removing it as a site system.  This can be a tedious task if you have hundreds or thousands of packages.  An alternative to doing this manually is to use the SDK.  I have attached a script that automates this task.  Note, the script does validate whether your DP still exists.  If you have already removed the DP as a site system and want to clean it up then you will have to remove the call to ValidDP().  Take note that if you do this then Distribution Manager will attempt to remove the package files from the DP so if it doesn't exist on the network then you will get errors in the distmgr.log and Distribution Manager component.



'Rslaten 03/2005

On Error Resume Next

WScript.Echo ""
WScript.Echo "SMSDPClean v1.3"
WScript.Echo "Usage: cscript.exe SMSDPClean "
WScript.Echo "Example: cscript.exe SMSDPClean.vbs myCentralSiteServer myDistributionPoint"
WScript.Echo ""

Dim SMSSiteServer, SMSNameSpace, oLocator, oServices, bDone

'Get Args, add error checking here if needed
SMSSiteServer = WScript.Arguments(0)
DP = WScript.Arguments(1)

'Get SMS namespace
SMSNameSpace = GetSMSNameSpace(SMSSiteServer)

'Connect to SMS namespace
Set oLocator = CreateObject("WbemScripting.SWbemLocator")
Set oServices = oLocator.ConnectServer(SMSSiteServer, SMSNameSpace,,,,,128)
If Err.number <> 0 Then
WScript.Echo "Error connecting to " &SMSNameSpace& " on " &SMSSiteServer& ": " &Err.Number
Set oLocator = Nothing
Set oServices = Nothing
WScript.Quit
End If

'Call main procedure
PackageLoop

'Loop until async task is done
Do While not bDone
WScript.Sleep 1000
Loop

Set oLocator = Nothing
Set oServices = Nothing
WScript.Quit


'Functions
'''''''''''''''''''''''''''''''''''''''''
'
'GetSMSNameSpace Function
'
'''''''''''''''''''''''''''''''''''''''''

Function GetSMSNameSpace(SiteServer)
On Error Resume Next
Dim
colNameSpaceQuery, refitem, refWMI
Set refWMI = GetObject("winMgmts:\\" &SiteServer&"\root\sms")
If Err.number <> 0 Then
WScript.Echo "Error connecting to SMS namespace on " &SiteServer
WScript.Quit
End If
Set
colNameSpaceQuery = refWMI.ExecQuery("select * from SMS_ProviderLocation")
For Each refitem in colNameSpaceQuery
GetSMSNameSpace = refitem.NamespacePath
Next
Set colNameSpaceQuery = Nothing
Set refitem = Nothing
Set refWMI = Nothing
End Function

'''''''''''''''''''''''''''''''''''''''''
'
'ValidDP Function
'
'''''''''''''''''''''''''''''''''''''''''

Function ValidDP(DP, SiteCode)
On Error Resume Next
Dim
SysRes, start, finish, tempDP
ValidDP = False
Set SysRes = oServices.ExecQuery("select * from sms_sci_sysresuse where SiteCode = '" &SiteCode& "'")
For each res in SysRes
start = InStr(res.NALPath,"=\\") + 3
finish = InStr(res.NALPath,"]MSWNET") - 2
tempDP = mid(res.NALPath,start,finish-start)
If (UCase(tempDP) = UCase(DP)) and (res.RoleName = "SMS Distribution Point") Then
Set SysRes = Nothing
ValidDP = True
Exit Function
End If
Next

Set SysRes = Nothing
End Function

'''''''''''''''''''''''''''''''''''''''''
'
'PackageLoop SubRoutine
'
'''''''''''''''''''''''''''''''''''''''''

Sub PackageLoop
On Error Resume Next
Dim
sinkcol, retValuecol
bDone = False
Set sinkcol = wscript.CreateObject("WbemScripting.SWbemSink","SINKCOL_")
retValuecol = oServices.ExecQueryAsync(sinkcol,"SELECT * FROM SMS_DistributionPoint")
If Err.Number <> 0 Then
WScript.Echo "Error running query:" &err.description
WScript.Quit
End If
End Sub
Sub
SINKCOL_OnObjectReady(objDP, objAsyncContext)
On Error Resume Next
Dim
start, finish, tempDP
start = InStr(objDP.ServerNALPath,"=\\") + 3
finish = InStr(objDP.ServerNALPath,"]MSWNET") - 2
tempDP = mid(objDP.ServerNALPath,start,finish-start)
If UCase(tempDP) = UCase(DP) Then
WScript.Echo "Found " &DP& " on "& objDP.SiteCode& " linked to package " &objDP.PackageID
If ValidDP(DP, objDP.SiteCode) Then
WScript.Echo "Validated " &DP& " for site " &objDP.SiteCode
objDP.Delete_()
If Err.number <> 0 Then
WScript.Echo "Failed to delete " &DP& " from package " &objDP.PackageID& " on site " &objDP.SiteCode
WScript.Echo "Error = " &Err.number& " - " &Err.Description
Else
WScript.Echo "Successfully deleted " &DP& " from package " &objDP.PackageID& " on site " &objDP.SiteCode
End If
Else

WScript.Echo DP& " is not specified as a distribution point on site " &objDP.SiteCode
End If
End If
End Sub
Sub
SINKCOL_OnCompleted(iHResult, objErrorObject, objAsyncContext)
bDone = True
End Sub

Feb 16, 2011

SMS/SCCM Command-line Actions





WMIC is a very powerful but rarely used tool to manage WMI from Command-line and it's part of the Operating-system since WindowsXP.... !

Some examples to trigger SMS/SCCM Client Actions from command line:

Disable Software-Distribution:
WMIC /namespace:\\root\ccm\policy\machine\requestedconfig path ccm_SoftwareDistributionClientConfig CREATE ComponentName="Disable SWDist",Enabled="false",LockSettings="TRUE",PolicySource="local",PolicyVersion="1.0" ,SiteSettingsKey="1" /NOINTERACTIVE

Re-Activate Software-Distribution:
WMIC /namespace:\\root\ccm\policy\machine\requestedconfig path ccm_SoftwareDistributionClientConfig WHERE ComponentName="Disable SWDist" delete /NOINTERACTIVE

Trigger Hardware Inventory:
WMIC /namespace:\\root\ccm path sms_client CALL TriggerSchedule "{00000000-0000-0000-0000-000000000001}" /NOINTERACTIVE

Trigger Software Inventory:
WMIC /namespace:\\root\ccm path sms_client CALL TriggerSchedule "{00000000-0000-0000-0000-000000000002}" /NOINTERACTIVE

Trigger DataDiscoverRecord (DDR) update:
WMIC /namespace:\\root\ccm path sms_client CALL TriggerSchedule "{00000000-0000-0000-0000-000000000003}" /NOINTERACTIVE

Force a FULL HW Inventory on next HW-Inv Schedule:
WMIC /namespace:\\root\ccm\invagt path inventoryActionStatus where InventoryActionID="{00000000-0000-0000-0000-000000000001}" DELETE /NOINTERACTIVE

Repair SMS/SCCM Agent on a remote client:
WMIC /node:%MACHINE% /namespace:\\root\ccm path sms_client CALL RepairClient

Repair a list (all clients listed in clients.txt) of remote SMS/SCCM Agents:
WMIC /node:@clients.txt /namespace:\\root\ccm path sms_client CALL RepairClient

Feb 1, 2011

SCCM Client Issue - Reassigning Site Code (script)

sSiteCode = "xxx"
sMachine = "."
set oCCMNamespace = GetObject("winmgmts://" & sMachine & "/root/ccm")
Set oInstance = oCCMNamespace.Get("SMS_Client")
set oParams = oInstance.Methods_("SetAssignedSite").inParameters.SpawnInstance_()
oParams.sSiteCode = sSiteCode
oCCMNamespace.ExecMethod "SMS_Client", "SetAssignedSite", oParams

'xxx - refers to site code
sMachine =MP

Jan 24, 2011

How to capture and report on a registry setting from Configuration Manager clients

This article seeks to offer a more complete solution on not only how to capture various registry settings from a client into the System Center Configuration Manager 2007 database, but to also demo how to build a sample query to report on those settings.
This sample will use a fictitious Software Application name for example purposes: "SampleAppOne"
With the following Registry Settings as an example:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\SampleAppOne]
"Description"="Sample Application One Description"
"DisplayName"="Sample Application One"
"Enable"=dword:00000001




First import the above registry settings into your test client.
Next, make backup copies of the following files before making the changes outlined below:
X:\Program Files\Microsoft Configuration Manager\Inboxes\clifiles.src\hinv\sms_def.mof
X:\Program Files\Microsoft Configuration Manager\Inboxes\clifiles.src\hinv\configuration.mof

Where X:\ is the drive where Configuration Manager 2007 is installed.
The following settings should be added at the end of the sms_def.mof
#pragma namespace (\\\\.\\root\\cimv2\\SMS)
#pragma deleteclass("SampleAppOne", NOFAIL)
[SMS_Report(TRUE),SMS_Group_Name("SampleAppOne"),SMS_Class_ID("Custom|SampleAppOne|1.0")]
Class SampleAppOne: SMS_Class_Template
{
[SMS_Report(TRUE),key] string KeyName;
[SMS_Report(TRUE)] String Description;
[SMS_Report(TRUE)] String DisplayName;
[SMS_Report(TRUE)] Uint32 Enable;
};

The following settings should be added at the end of the configuration.mof
#pragma namespace (\\\\.\\root\\cimv2)
#pragma deleteclass("SampleAppOne", NOFAIL)
[DYNPROPS]
Class SampleAppOne
{
[key] string KeyName;
String Description;
String DisplayName;
Uint32 Enable;
};
[DYNPROPS]
Instance of SampleAppOne
{
keyname="SampleAppOne";
[PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\SampleAppOne|Description"),Dynamic,Provider("RegPropProv")] Description;
[PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\SampleAppOne|DisplayName"),Dynamic,Provider("RegPropProv")] DisplayName;
[PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\SampleAppOne|Enable"),Dynamic,Provider("RegPropProv")] Enable;
};

Once you have backed up and made the changes outlined above, Run mofcomp.exe on both the sms_def.mof and configuration.mof as follows:
%WINDIR%\System32\WBEM\Mofcomp.exe "X:\Program Files\Microsoft Configuration Manager\Inboxes\clifiles.src\hinv\sms_def.mof"
%WINDIR%\System32\WBEM\Mofcomp.exe "X:\Program Files\Microsoft Configuration Manager\Inboxes\clifiles.src\hinv\configuration.mof"

Where X:\ is the drive where Configuration Manager 2007 is installed.
Next we need to force Hardware Inventory up from a client to test and/or wait until the next scheduled Hardware Inventory is run. The changes made to the mof files on the server should start collecting the information from the client’s registry during the next Hardware Inventory Cycle.
In my testing, once the database was updated with the new tables from the custom Hardware Inventory (db0.SampleAppOne_data, history, etc...) I had to restart the SCCM 2007 Server for the mof changes to show up in the New Query as a selectable attribute. Once the tables start showing up in the SMS_Database, then restart the SCCM Server, and proceed to the next steps.
Now you can run a query from ConfigMgr 2007 Console to get a basic report showing Computer name, and a value from one of the registry keys for this computer as follows:
select SMS_R_System.Name, SMS_G_System_CUSTOM_SAMPLEAPPONE_1_0.Enable from  SMS_R_System inner join SMS_G_System_CUSTOM_SAMPLEAPPONE_1_0 on SMS_G_System_CUSTOM_SAMPLEAPPONE_1_0.ResourceId = SMS_R_System.ResourceId where SMS_G_System_CUSTOM_SAMPLEAPPONE_1_0.Enable = 1
This should return the computer names of any clients that have the registry setting Enable with a value = 1

Jan 23, 2011

The Configuration Manager Service Pack Install Guide

This document was created to help in troubleshooting Configuration Manager Service Pack 2 (SP2) install failures. This document is not entirely specific to Service Pack 2 and can apply to Service Pack 1 installs, upgrades from SMS 2003 to SCCM, and future service pack or Configuration Manager versions that rely on .mof file compilations, SQL SPNS, provider DLLs, etc.

Contents:

Section 1 Pre-Upgrade Best Practices
Section 2 General Troubleshooting
Section 3 List of Known Issues and Solutions:
A: SPN issues with SQL
B: Time Skew between remote SQL and Site Server
C: Re-Registering relevant files / errors attempting to re-register needed files.
D. Deleting Temp Files, setting Temp variables.
E. Searching for a "bad" custom or customized report
F. Checking for pre-existing duplicate reports that are new to SCCM SP2
G. Upgrade fails due to registry setting.
H. Site System does not have rights to remote SQL System or Clustered SQL Nodes
______________________________


Section 1 Pre-Upgrade Best Practices
It is important to note that some of the problems outlined below can leave your Configuration Manager or SMS installation in an unusable state (i.e. Admin Console will not launch and connect) this is because the upgraded files have already been copied to the bin\I386 directory of your SCCM installation. In some case setup may rollback successfully and in others you *may* be able to reinitiate upgrade over the top of a failed installation however in others you may have to fully restore to your previous state; SCCM RTM, SP1, SMS 2003, etc, to begin troubleshooting.
Always insure you have a complete current and full SMS or Configuration Manager backup (performed when SMS services are disabled, all directories, SQL DB, registry settings, etc..) before upgrading your product. Always utilize the testdbupgrade setup switch on a copy(!) of the site database command to insure your database can be upgraded without error. Testdbupgrade can help you insure you are ok to upgrade however you cannot upgrade a database after you have run testdbupgrade against it.
How to Test the Site Database Upgrade Process: http://technet.microsoft.com/en-us/library/bb693648.aspx
______________________________
Section 2 General Troubleshooting
Most problems we have seen thus far have been after file copy, around step 4; registering the SMS provider, and compiling .mof files. It takes setup about 10-15 minutes to get to this step. This document primarily focuses on issues of this type.
There are several things to consider in the scenario of  .MOF comp failures. First off you should not have to keep going through SP2 setup after testing solutions. Instead try to manually compile the .mof that fails. In most (not all) cases you will get an error doing this as well. Once you have implemented a solution and can manually compile the .mof file that setup was failing on, it may be safe to assume that SCCM SP2 setup can again be run and may pass this stage.
Things to look at (not necessarily in this order):
  • Relevant log files: C:\ConfigMgrSetup.log, %ConfigMgrInstallDir%\Logs\Smsprov.log and SMSProv.lo_, %Windir%\System32\Wbem\Mofcomp.log
  • Verify that DCOM and Windows Management Instrumentation (WMI) is enabled
  • Take a SQL Profiler (yes, because we are going through the Provider we do look in SQL. Specifically at the SMS_Reports table)
  • Double check WMI permissions
  • Check Security Rights in the SMS Admin console for the user that is executing the mofcomp command against smsrprt.mof
  • Verify permissions on the extnprov.dll file
  • We write .tmp files to various locations during compile. Run a Filemon.
As stated above, the files to compile during setup should be able to compile outside of setup. it is likely that you will not be able to complete setup successfully until you can compile smsrprt.mof (or whatever mof file is failing to compile) manually successfully from a command prompt.
If you try to manually compile the SMSrprt.mof and it fails you usually get the following error:
E:\SMS\bin\i386>mofcomp smsrprt.mof
Microsoft (R) 32-bit MOF Compiler Version 5.2.3790.3959
Copyright (c) Microsoft Corp. 1997-2001. All rights reserved.
Parsing MOF file: smsrprt.mof
MOF file has been successfully parsed
Storing data in the repository...
An error occurred while processing item X defined on lines X - X in file smsrprt.mof:
Compiler returned error 0x80041001

It may be worth noting that 0x80041001 = generic failure, so this is not helpful other than to let you know that you have not resolved your issue as of yet since you are not able to manually compile this file.
______________________________
Section 3 List of Known Issues and Solutions
The most common issue we see with SP2 upgrades is a failed to compile .mof error around the time that SP2 is trying to upgrade the SMS provider component:
<12-09-2009 15:17:37> CompileMOFFile: Starting to compile MOF C:\Program Files (x86)\Microsoft Configuration Manager\bin\i386\smsRprt.mof
<12-09-2009 15:18:11> CompileMOFFile: Failed to compile MOF C:\Program Files (x86)\Microsoft Configuration Manager\bin\i386\smsRprt.mof, error -1
<12-09-2009 15:18:11> Setup cannot compile MOF file C:\Program Files (x86)\Microsoft Configuration Manager\bin\i386\smsRprt.mof.  Do you want to continue?
<12-09-2009 15:18:11> Setup failed to install SMS Provider.  For more information about this error, see Microsoft Knowledge Base at <
http://microsoft.com> or contact Microsoft Technical Support for further assistance.
A. SPN issues with SQL:
The first thing you will want to check is that the SQL SPNs are registered correct in Active Directory. In a nutshell 2 things can go wrong here:
1. Duplicate SPNs for SQL
2. SQL is running under a Domain User account and the SPNs have not been created manually.
Resolution: Use the setspn tool.  You can find it online if it's not installed.
1. setspn -l nameofcomputerrunningsql > C:\ComputerSPN.txt
2. setspn -l domain\accountSQLisRunningUnder > C:\SQLaccountSPN.txt
3. setspn -x > C:\duplicates.txt

So if your SQL server is called sqlcomputer and the account SQL is running under is called SQLAccount number 1 and 2 above would be :
1. setspn -l sqlcomputer > C:\ComputerSPN.txt
2. setspn -l domain\sqlaccount C:\SQLaccountSPN.txt

Use the txt files above to insure SQL SPNs are registered correctly. You should have the entries listed as follows under the domain account running SQL or the actual SQL Servers computer account:
MSSQLSvc/sqlcomputer.domain.com:1433
MSSQLSvc/sqlcomputer:1433

If you are running a SQL cluster insure the same for all physical nodes and the virtual instance name.
To add a FQDN and NETBIOS SPN for SQL use the following syntax:
setspn -a MSSQLSvc/SQLcomputer.domain.com:1433 Domain\SQLaccount
and
setspn -a MSSQLSvc/SQLcomputer:1433 Domain\SQLaccount
To delete a duplicate SPN use the -d switch:
SETSPN -D MSSQLSvc/SQLcomputer:1433 Domain\SQLcomputer
You can also easily view SPNs (Service Principal Names) using ADSIEDIT.msc (install from a Windows  Server CD, \Support Tools\Suptools.msi) right click the computer or user account object and view attributes, scroll down to ServicePrincipalName.
Note: SQL creates its OWN SPN for the computer account when SQL is running under the Local System account. Having more then one SPNs registered under different accounts with the same machine name as the one SQL is running on will cause these problems as well.
Switches for SetSPN:
-R = reset HOST ServicePrincipalName
Usage: setspn -R computername
-A = add arbitrary SPN
Usage: setspn -A SPN computername
-S = add arbitrary SPN after verifying no duplicates exist
Usage: setspn -S SPN computername
-D = delete arbitrary SPN
Usage: setspn -D SPN computername
-L = list registered SPNs
Usage: setspn [-L] computername
-Q = query for existence of SPN
Usage: setspn -Q SPN
-X = search for duplicate SPNs
Usage: setspn -X
B. Time Skew between remote SQL and Site Server:
If SQL is remote from the site server you are trying to upgrade insure there is not a time skew between the two machines. A default Windows Active Directory domain has a Kerberos policy to allow no more than a 5 minute time difference between machines for successful Kerberos authentication.
C. Re-Registering relevant files:
In some case re-registering a couple of files has resolved SP2 install issues.
Configmgrsetup.log:
<11-14-2008 23:20:11> CompileMOFFile: Starting to compile MOF
E:\SMS\bin\i386\smsRprt.mof
<11-14-2008 23:20:12> CompileMOFFile: Failed to compile MOF
E:\SMS\bin\i386\smsRprt.mof, error –2147217407

If you try to manually compile smsRprt.mof you get the following error:
E:\SMS\bin\i386>mofcomp smsrprt.mof
Microsoft (R) 32-bit MOF Compiler Version 5.2.3790.3959
Copyright (c) Microsoft Corp. 1997-2001. All rights reserved.
Parsing MOF file: smsrprt.mof
MOF file has been successfully parsed
Storing data in the repository...
An error occurred while processing item 1 defined on lines 7 - 32 in file
smsrprt.mof:
Error Number: 0x80041013, Facility: WMI
Description: Provider load failure
Compiler returned error 0x80041001

From the command prompt type the following:
  • Change directory to \Program Files\Microsoft Configuration Manager\Bin\I386\
  • Run regsvr32 smsprov.dll
  • Run regsvr32 extnprov.dll
Similar to the above issue during the fourth step of SCCM setup you may see the following pop up error
message:
Fatal Error Setup Failed to install SMS Provider
The ConfigMgrSetup.log may read as follows:
TaskSequenceProvider.mof comp failure
Once this occurs the SCCM services will not start and the site server is not in a usable state.
Additionally, after you quit setup you are unable to manually mofcomp smsprov.mof or TaskSequenceProvider.mof. The following error occurs:
Provider Load Failure
If you try to manually regsvr32 smsprov.dll you receive the following:
LoadLibrary("D:\SMS\Bin\I386\smsprov.dll") failed - The specified module could not
be found.

The error is valid although this is *also* the default regsvr32 error when a path to a file you are trying to register cannot be found or the file you are trying to register does not exist in the defined path.
The solution is to use Depends.exe (Dependency Walker) against the file that wont re-register SMSprov.dll (Note: not all files are "registerable"!) http://www.dependencywalker.com/
In our case it was missing MSVCR80.dll and it wanted this file in the \Microsoft Configuration Manager\Bin\I386
directory. Copy the missing files that depends identifies to the \Bin\I386 directory.
Once placing the file there we were able to manually register SMSProv.dll and Extnprov.dll and complete setup.
D. Deleting Temp Files, Setting Temp Environment Variables:
The following error appeared in the ConfigMgrSetup.log:
<02-19-2008 12:52:42> VC redist is being installed from C:\DOCUME~1\customer\Local
Settings\Temp\vcredist_x86.exe.

***You may get an MSIEXEC help screen popup although no error will show up in the log.***
<02-19-2008 13:08:23> CompileMOFFile: Starting to compile MOF C:\Program
Files\Microsoft Configuration Manager\bin\i386\smsRprt.mof
<02-19-2008 13:08:24> CompileMOFFile: Failed to compile MOF C:\Program
Files\Microsoft Configuration Manager\bin\i386\smsRprt.mof, error -2147217407
<02-19-2008 13:08:26> Setup cannot compile MOF file C:\Program Files\Microsoft
Configuration Manager\bin\i386\smsRprt.mof. Do you want to continue?

The .mof's referenced in the ConfigMgrSetup.log above could not be compiled manually using mofcomp.exe.
Change the TEMP folder location from %USERPROFILE%\Local Settings\Temp to C:\TEMP and deleting all temp files fixed this issue. An alternate solution and better explanation for this behavior is as follows:
In one instance, the issue was caused when the admin logged onto the server BEFORE 8.3 support was turned off and therefore his user profile was created in this manner, including the path to the temp directory.  Configuration Manager does not support 8.3 and in fact, the pre-req checker will determine if 8.3 support is enabled. In this instance, however, it was off by the time the setup was run and it does NOT check the logged on user for how their profile was created.
Log on with a user who has a profile created AFTER 8.3 support was disabled or delete the current users profile and have them log back on to re-create a new profile in the proper format and run setup again
E. Searching for a bad custom or duplicate report: Look in the C:\ConfigMgrSetup.log for something like this:
<12-27-2009 14:02:36> ***SqlError: [42S01][2714][Microsoft][ODBC SQL Server Driver][SQL Server]There is already an object named 'ExistingRights_Setup' in the database.
<12-27-2009 14:03:04> CompileMOFFile: Failed to compile MOF F:\Program Files\Microsoft Configuration Manager\bin\i386\smsRprt.mof, error -2147217407

And a corresponding entry in the SMSprov.log:
[3338][Sun 12/27/2009 14:03:03]:ERROR> SQL command failed: update Report set Category = 'Software Distribution - Packages', Comment = 'Displays all packages at a site.', DrillThroughReportID = 127,
DrillThroughURL = null, GraphCaption = '', GraphType = null, GraphXCol = 1, GraphYCol = 2, MachineDetail = 0, MachineSource = 0, Name = 'All packages', RefreshInterval = 0, ReportGUID = '{54AB50FF-A9E8-4116
-8D56-AB10B6CD66A0}', StatusMessageDetailSource = 0, UnicodeData = 0, XColLabel = '', YColLabel = ''  where ReportID = 132
***Note above that the report called "All Packages" is referenced***
e:\nts_sms_fre\sms\siteserver\sdk_provider\smsprov\sspclassbase.cpp(841) : SQL command failed: 
SQL Error: [23000][2627][Microsoft][ODBC SQL Server Driver][SQL Server]Violation of UNIQUE KEY constraint 'Report_AK2'. Cannot insert duplicate key in object 'dbo.Report'.
SQL command failed:  [23000][2627][Microsoft][ODBC SQL Server Driver][SQL Server]Violation of UNIQUE KEY constraint 'Report_AK2'. Cannot insert duplicate key in object 'dbo.Report'.

To resolve this issue we looked at the "All Packages" report, this report is included in a default install of SCCM Sp1 and SCCM SP2. However in this customers case it was noted that the report itself had been somewhat modified. To resolve this issue we deleted this report after which, we were able to compile the smsrprt.mof manually and thus SCCM SP2 install succeeded. After the install SCCM SP2 did recreate this report with the default queries. An alternate resolution may have been to simply modify the customized query in this report back to the SCCM SP1 defaults. It is not known why the report was not able to be upgraded as that troubleshooting path was not pursued.
F. Checking for pre-existing duplicate reports that are new to SCCM SP2: In a different case that was very similar to Item E, another issue was discovered. The customer had created a custom report in SCCM SP1 called “Computers that do not meet the minimum system requirements for Windows 7”. This report does not exist in SP1 however SCCM SP2 tries to create this very same report as part of its default install.
The customer was seeing this message in ConfigMgrSetup.log:
<12-09-2009 15:17:37> CompileMOFFile: Starting to compile MOF C:\Program Files (x86)\Microsoft Configuration Manager\bin\i386\smsRprt.mof
<12-09-2009 15:18:11> CompileMOFFile: Failed to compile MOF C:\Program Files (x86)\Microsoft Configuration Manager\bin\i386\smsRprt.mof, error -1
<12-09-2009 15:18:11> Setup cannot compile MOF file C:\Program Files (x86)\Microsoft Configuration Manager\bin\i386\smsRprt.mof.  Do you want to continue?

In the SMSProv.log there was a message similar to the following:
Violation of UNIQUE KEY constraint 'Report_AK2'. Cannot insert duplicate key in object 'dbo.Report'.
Report names can in fact be the same as long as their conditions and queries are different. For example create a new report and call it “Computers that do not meet the minimum system requirements for Windows 7”  for the category type select Asset Intelligence. This report can be created without error. However if you clone an existing report and try to name it the same you get a failure in the console.
"A report with this name and category already exists.  Change the Name of this report to create a unique combination."
As with item E above, the resolution is to delete the pre-existing custom report and let SP2 recreate this report for you. A few other reports that do not exist in SCCM SP1 but are created in SCCM Sp2 to look out for are:
  • “Computers that meet the recommended system requirements for Windows 7”
  • “Computers that do not meet the minimum system requirements for Windows 7”
  • "Windows 7 Upgrade Assessment - Hardware summary for all systems in a collection"
Note: Likely there are others as well. If you feel you have this issue compare SCCM SP2 Reports with SCCM SP1 Reports.
G. Upgrade fails due to registry setting:
In the ConfigMgrSetup.LOG:
<01-14-2009 16:50:22> CompileMOFFile: Compiled MOF D:\SMS\bin\i386\smsprov.mof
<01-14-2009 16:50:22> CompileMOFFile: Starting to compile MOF
D:\SMS\bin\i386\smsRprt.mof
<01-14-2009 17:06:12> CompileMOFFile: Failed to compile MOF
D:\SMS\bin\i386\smsRprt.mof, error -2147217407
<01-14-2009 17:06:12> Setup cannot compile MOF file D:\SMS\bin\i386\smsRprt.mof.

In the MofComp.LOG file:
(Wed Jan 14 16:50:23 2009.1023203) : Storing data in the repository...
(Wed Jan 14 17:06:12 2009.1971531) : An error occurred while processing item 1
defined on lines 7 - 32 in file D:\SMS\bin\i386\smsRprt.mof:
(Wed Jan 14 17:06:12 2009.1971546) : Error Number: 0x800706be, Facility: Win32
Description: The remote procedure call failed.

Cause: This can occur if the following registry value is set:
HLKM\Software\Microsoft\SMS\Providers
SQL Cache Logging =1

Resolution: To resolve this issue, set SQL Cache Logging=0
Note: SQl Cache Logging should be enabled only for troubleshooting purposes and should not be left "on".
For more information see SMS: How to Enable SQL Cache Logging in the Systems Management Server Provider
http://support.microsoft.com/kb/295040
H. Site System does not have rights to remote SQL System or Clustered SQL Nodes:
ConfigMgrSetup.log:
<05-19-2008 15:10:45> CompileMOFFile: Starting to compile MOF D:\Program
Files\Microsoft Configuration Manager\bin\i386\smsRprt.mof
<05-19-2008 15:11:26> CompileMOFFile: Failed to compile MOF D:\Program
Files\Microsoft Configuration Manager\bin\i386\smsRprt.mof, error -1
<05-19-2008 15:11:26> Setup cannot compile MOF file D:\Program Files\Microsoft
Configuration Manager\bin\i386\smsRprt.mof. Do you want to continue?

SMSPROV.log showed a log in failure for the computer account of the site server.  Check the rights for the Clustered SQL instance per http://technet.microsoft.com/en-us/library/bb680513.aspx
In this case we found that the computer account for the site server was not a member of the local admin group on either node. Adding the site server computer account to the local administrators group on both nodes and installation proceeded to a successful conclusion.