|
 |
 |
 |
 |
Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms
of Use |
Trademarks
Article ID: 925642 - Last Review: October 27, 2006 - Revision: 1.0 The Import Object Wizard stops responding and the Mmc.exe process uses 99 percent of CPU resources when you try to import a report in Systems Management Server 2003When you use the Import Object Wizard to import a report into Microsoft Systems Management Server (SMS) 2003, you experience the following symptoms: - The Import Object Wizard stops responding (hangs).
- The Mmc.exe process uses approximately 99 percent of CPU resources.
- The report is not imported successfully.
Note In this situation, you must end, or "terminate," the Mmc.exe process to exit the Import Object Wizard. You experience this problem if you import a report that contains a large SQL query. This problem occurs because of a limitation in the Import Object Wizard. The Import Object Wizard buffer cannot handle large SQL queries. To work around this problem, use one of the following methods, as appropriate for the situation. Method 1: Paste the SQL query into a new reportInstead of using the Export Object Wizard to export and then import the report information, copy the SQL query that you want to a new report. To do this, follow these steps. - Copy the SQL query from the source report. To do this, follow these steps:
- Start the SMS Administrator console Microsoft Management Console (MMC) snap-in.
- Expand Reporting, and then click Reports.
- Right-click the report from which you want to copy the SQL query, and then click Properties.
- In the ReportName Properties dialog box, click Edit SQL Statement.
- In the Report SQL Statement dialog box, copy the SQL statement
that appears in the SQL statement box to a text file.
- Click Cancel two times.
- Paste the SQL query into a new report. To do this, follow these steps:
- In the SMS Administrator console MMC snap-in, expand Reporting, right-click Reports, point to New, and then click Report.
- In the Report Properties dialog box, type a name in the Name box.
- In the Category list, click an appropriate report category such as Software Update - Compliance, and then click Edit SQL Statement.
- In the Report SQL Statement dialog box, paste the SQL statement
that you copied in step 1e into the SQL statement box.
- Click OK two times.
Method 2: Use a script to copy the SQL query to a new reportMicrosoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. You can use the SMS 2003 software development kit (SDK) to export and import a report. The following example script illustrates how you can do this.
'Run locally on the central site server where the report exists
'1st parameter should be the report ID
'The remaining parameters should be the site codes of the...
'...child sites for which you want to import the report
'Example: cscript.exe ImportReport.vbs 166 PRI SEC CLD
'This will take report 166 and import it into the PRI, SEC, and CLD child sites
'Start Script
Main
Sub Main
Dim oServices, iReportID, aSites
'Make connection to WMI
Set oServices = GetObject("winMgmts:" & GetSMSNameSpace())
'Get Command Line Arguments
iReportID = GetReportID()
aSites = GetSiteNamespaces(oServices)
'Make sure report exists
If ValidateReport(oServices, iReportID) Then
TransferReport oServices, iReportID, aSites
Else
WScript.Echo "Report ID " & iReportID & " is not a valid report ID"
DisplayHelp()
WScript.Quit
End If
Set oServices = Nothing
End Sub
Sub TransferReport(oWMI, iID, aSites)
On Error Resume Next
Dim oQuery, oReport, oServices, oSite, oNewReport, oLazySQLQuery
'Get main report object
Set oQuery = oWMI.ExecQuery("select * from SMS_Report where ReportID = " & iID)
For each oReport in oQuery
For each oSite in aSites
'Connect to the remote server
Set oServices = GetObject("winMgmts:" & oSite.SMSNameSpace)
If Err.number <> 0 Then
WScript.Echo "Error connecting to SMS namespace:" & oSite.SMSNameSpace
WScript.Echo "Error = " & Err.number & " - " & Err.Description
WScript.Echo "Will not transfer report to " & oSite.ServerName
Else
'Create a new report and clone it so it's identical to the original
Set oNewReport = oServices.Get("SMS_Report").SpawnInstance_
'Set properties
oNewReport.Category = oReport.Category
oNewReport.Comment = oReport.Comment
oNewReport.DrillThroughColumns = oReport.DrillThroughColumns
oNewReport.DrillThroughURL = oReport.DrillThroughURL
oNewReport.GraphCaption = oReport.GraphCaption
oNewReport.GraphType = oReport.GraphType
oNewReport.GraphXCol = oReport.GraphXCol
oNewReport.GraphYCol = oReport.GraphYCol
oNewReport.Name = oReport.Name
oNewReport.NumPrompts = oReport.NumPrompts
oNewReport.RefreshInterval = oReport.RefreshInterval
oNewReport.ReportParams = oReport.ReportParams
oNewReport.StatusMessageDetailSource = oReport.StatusMessageDetailSource
oNewReport.XColLabel = oReport.XColLabel
oNewReport.YColLabel = oReport.YColLabel
'Set lazy properties
'Note, report ID's may not match for the 1st two properties
oNewReport.DrillThroughReportID = oReport.DrillThroughReportID
oNewReport.DrillThroughReportPath = oReport.DrillThroughReportPath
oNewReport.MachineDetail = oReport.MachineDetail
oNewReport.MachineSource = oReport.MachineSource
Set oLazySQLQuery = oWMI.Get("SMS_Report.ReportID=" & iID)
oNewReport.SQLQuery = oLazySQLQuery.SQLQuery
'Write the instance to WMI
oNewReport.Put_()
If Err.number <> 0 Then
WScript.Echo "Report failed to transfer to site " & oSite.SiteCode
WScript.Echo "Error = " & Err.number & " - " & Err.Description
Else
WScript.Echo "Report transfered to site " & oSite.SiteCode
End If
End If
Next
Next
Set oServices = Nothing
Set oLazySQLQuery = Nothing
End Sub
Function ValidateReport(oWMI, iID)
On Error Resume Next
Dim oQuery, oItem
Set oQuery = oWMI.ExecQuery("select * from SMS_Report where ReportID = " & iID)
For Each oItem in oQuery
WScript.Echo "Report to transfer: " & oItem.Name
ValidateReport = TRUE
Next
Set oQuery = Nothing
End Function
Function GetReportID()
On Error Resume Next
Dim iID
iID = WScript.Arguments(0)
If Err.number <> 0 Then
WScript.Echo "Failed to get report ID from command line!"
DisplayHelp()
WScript.Quit
Else
GetReportID = iID
End If
End Function
Function GetSiteNameSpaces(oWMI)
On Error Resume Next
Dim aArg, oSites, oSite, i, oSiteServer, sNameSpace
Dim aAllData(), aSiteServerNames(), aArgs()
'Get child site codes off command line
If WScript.Arguments.Count < 2 Then
WScript.Echo "Failed to get child site codes from command line!"
DisplayHelp()
WScript.Quit
End if
For i = 1 to WScript.Arguments.Count - 1
ReDim Preserve aArgs(i-1)
aArgs(i-1) = WScript.Arguments(i)
Next
'Make sure we actually got some child site codes
If i <= 1 Then
WScript.Echo "Failed to get child site codes from command line"
DisplayHelp()
WScript.Quit
End If
'Query WMI to get SMS server names for each site code
i = 0
Set oSites = oWMI.ExecQuery("select * from SMS_Site")
For each oSite in oSites
For each aArg in aArgs
If UCASE(aArg) = UCASE(oSite.SiteCode) Then
Set oSiteObject = New ChildSite
oSiteObject.SiteCode = oSite.SiteCode
oSiteObject.ServerName = oSite.ServerName
ReDim Preserve aSiteServerNames(i)
Set aSiteServerNames(i) = oSiteObject
i = i + 1
End If
Next
Next
'Connect to each site server to get the SMS namespace
i = 0
For each oSiteServer in aSiteServerNames
sNameSpace = GetRemoteSMSNameSpace(oSiteServer.ServerName)
If sNameSpace <> FALSE Then
Set oSiteObject = New ChildSite
oSiteObject.SiteCode = oSiteServer.SiteCode
oSiteObject.ServerName = oSiteServer.ServerName
oSiteObject.SMSNameSpace = sNameSpace
ReDim Preserve aAllData(i)
Set aAllData(i) = oSiteObject
i = i + 1
End If
Next
GetSiteNameSpaces = aAllData
Set oSites = Nothing
Set oSite = Nothing
Set oSiteServer = Nothing
End Function
Function GetSMSNameSpace()
On Error Resume Next
Dim colNameSpaceQuery, refitem, refWMI
Set refWMI = GetObject("winMgmts:\root\sms")
If Err.number <> 0 Then
WScript.Echo "Error connecting to SMS namespace"
DisplayHelp()
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
Function GetRemoteSMSNameSpace(sServer)
On Error Resume Next
Dim colNameSpaceQuery, refitem, refWMI
Set refWMI = GetObject("winMgmts:\\" & sServer & "\root\sms")
If Err.number <> 0 Then
WScript.Echo "Error connecting to SMS namespace on " & sServer
WScript.Echo "Error = " & Err.number & " - " & Err.Description
WScript.Echo "Will not transfer report to " &sServer
GetRemoteSMSNameSpace = FALSE
End If
Set colNameSpaceQuery = refWMI.ExecQuery("select * from SMS_ProviderLocation")
For Each refitem in colNameSpaceQuery
GetRemoteSMSNameSpace = refitem.NamespacePath
Next
Set colNameSpaceQuery = Nothing
Set refitem = Nothing
Set refWMI = Nothing
End Function
Sub DisplayHelp()
WScript.Echo "Syntax for ImportReport.vbs (must be run on parent site server)"
WScript.Echo "cscript.exe ImportReport.vbs <ReportID> <ChildSiteCode(s)>"
WScript.Echo "Example: cscript.exe ImportReport.vbs 166 PRI SEC CLD"
End Sub
Class ChildSite
Public SiteCode
Public ServerName
Public SMSNamespace
End Class
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
The following file is available for download from the Microsoft Download Center: Collapse this imageExpand this image Download the Systems Management Server 2003 Software Development Kit (SDK) v3.1 package now.
(http://www.microsoft.com/downloads/details.aspx?FamilyId=58833CD1-6DBB-45BB-BB77-163446068EF6&amp;amp;displaylang=en)
Release Date: July 22, 2005
For more information about how to download Microsoft support files, click the following article number to view the article in the Microsoft Knowledge Base:
119591Â
(http://kbalertz.com/Feedback.aspx?kbNumber=119591/
)
How to obtain Microsoft support files from online services
Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help prevent any unauthorized changes to the file.
APPLIES TO- Microsoft Systems Management Server 2003
| kbpending kbenv kbtshoot kbbug kbprb KB925642 |
Community Feedback System
Very often, it takes hours to solve a problem. Very often, you've looked high
and low, and have tried a lot of solutions. When you finally found it, chances
are, it was because someone else helped you. Here's your chance to give back.
Use our community feedback tool to let others know what worked for you and what
didn't.
Please also understand that the community feedback system is not warranted to be
correct, it's simply a system that we've built to let people try and help each
other. If something in a feedback response doesn't make sense to you, or you're
not comfortable making changes that the feedback talks about (like registry
edits), please consult a professional.
Thank you for using kbAlertz.com Feedback System.
-- Scott Cate
|
 |
 |
 |
 |
 |
 |
 |
| |