Importing Knowledge into Service Manager 2010

Importing Knowledge into Service Manager 2010

  • Comments 8
  • Likes

Anders strikes again – this time with a blog article about importing knowledge into Service Manager using CSV import.

http://contoso.se/blog/?p=1285

A few things I would add to his excellent article:

1) Here is a list of the options for the enum data type fields (at least out of the box):

Article Type:

Enum ID Enum GUID
(what you need to put in the CSV file)
System.Knowledge.ArticleTypeEnum.FAQ 2EFD3759-CDB9-4E4D-E557-211855A8C92F
System.Knowledge.ArticleTypeEnum.HowTo 9990416C-4F5F-1204-DDC4-0EA678AEEC9E
System.Knowledge.ArticleTypeEnum.Issue 38D64001-FB34-5E74-D19B-A65BB189E68C

Status:

Enum ID Enum GUID
(what you need to put in the CSV file)
System.Knowledge.StatusEnum.Archived DF9ED3CF-083B-06E8-9679-DADF4145950D
System.Knowledge.StatusEnum.Draft 10F171DF-3AB1-648D-D151-D83A5171DD7B
System.Knowledge.StatusEnum.Published 761B8724-8307-8F26-3DC5-CF017922B603


Tag:

Enum ID Enum GUID
(what you need to put in the CSV file)
System.Knowledge.TagEnum.Duplicate 0441EC5E-11F6-C183-9493-3F16D3D8A850
System.Knowledge.TagEnum.Incomplete 2CD43F1E-6E68-FCD4-E923-55D0F858CDC6
System.Knowledge.TagEnum.ToRewrite F982E5B1-7864-7FC5-D0A4-8E000C91C241

Category:

Enum ID Enum GUID
(what you need to put in the CSV file)
System.Knowledge.CategoryEnum.EnterpriseApplication 8F5BB609-AB38-8E50-B6EB-216E2F7CD51B
System.Knowledge.CategoryEnum.Hardware F452BA19-6AD2-1207-5E20-D0CD9CCDAB8D
System.Knowledge.CategoryEnum.Networking FFA272B8-97A4-0127-1BE0-A971F75CDA64
System.Knowledge.CategoryEnum.Other 75F786E2-CAA7-E7E9-47A0-BCC714BF1EDF
System.Knowledge.CategoryEnum.Printing 2EFFF8FE-17A1-F30E-E05F-89C8E65F00E7
System.Knowledge.CategoryEnum.Software 3D899B78-D829-CD96-9958-5AD5FBC958D3

2) Although Anders didn’t list it in his blog post you can also set the PrimaryLocaleID property.  It is an integer from this list (right most column).

3) Analyst or End User content can be in Rich Text Format (RTF).  In Anders example he shows you how to import knowledge from a .txt file but you can also do it from .rtf files if you want to have rich formatting of the content.

4) I’ve put together some sample  files for you to use:

  • TestDataMap.xml is the data mapping file you’ll need.
  • TestData.csv is a sample data file.  You can open it in Excel for easier data entry.  Don’t forget to remove the header row before you try to do the actual import!
  • TestEndUser.rtf and TestAnalyst.rtf are test content documents referenced by the TestData.csv file.

You can get the files from our SkyDrive.

5) I highly recommend doing this in a test environment first before you bulk insert into a production environment.  If there is a problem don’t forget about bulk deleting using PowerShell.  The class ID for knowledge articles is System.Knowledge.Article in case you need to do some clean up.

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • Any possible way to reference PDF files with this method Travis?

  • @Brian -

    Sorry, no.  Only RTF.

    Service Manager does have a property on each knowledge article that allows you to provide a URL to a web accessible document that can be viewed in a browser.  You could put your PDF files on a SharePoint site or something like that and then create knowledge articles in SCSM which have external URLs that point to those documents.

    The documents will show up in a browser control on the knowledge article form.

    The downside of this approach is that the content of the knowledge articles is not searchable.  You can still search by the knowledge article title, keywords, abstract, etc. though.

  • Hi

    I have installed SCSM and want to populate the KB.

    Tried this method, having found the csv import in conectors, and it errors.

    Has something changed since this was put together? looks like it doesnt like the GUID.

    he errors I get are:

    Matched property ArticleID of class System.Knowledge.Article in format file with class property name having different casing: ArticleId. Consider using exact casing.

    Warning: possible error in row on line 1 of CSV file C:\Users\SPayton\Documents\TestData.csv. The following message was logged:

    --> Could not find cached enumeration value ArticleType for property ArticleType, class System.Knowledge.Article in enumeration cache. You must specify either the Name or Guid of an enumeration of type System.Knowledge.ArticleTypeEnum.

    Error: Could not import the row on line 1 of CSV file C:\Users\SPayton\Documents\TestData.csv. Object creation failed with the following error:

    --> Exception of type 'Microsoft.EnterpriseManagement.CSVImport.CSVInstanceException' was thrown.

    Warning: possible error in row on line 2 of CSV file C:\Users\SPayton\Documents\TestData.csv. The following message was logged:

    --> Error setting binary property End User Content of class Knowledge Article. Could not open TestEndUser.rtf as a file stream.

    Inner Exception:

    System.IO.FileNotFoundException: Could not find file 'C:\Program Files\Microsoft System Center 2012\Service Manager\TestEndUser.rtf'.

    File name: 'C:\Program Files\Microsoft System Center 2012\Service Manager\TestEndUser.rtf'

      at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)

      at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)

      at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)

      at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)

      at Microsoft.EnterpriseManagement.CSVImport.ObjectBuildNode.SetProperties(EnterpriseManagementObject objectItem, String[] columnIn, Int32 instanceOffset, EnumerationCache enumCache, Int32 lineNumber, String fileName, List`1 fileStreamList, CSVImportLog csvImportLog)

    Error: Could not import the row on line 2 of CSV file C:\Users\SPayton\Documents\TestData.csv. Object creation failed with the following error:

    --> Exception of type 'Microsoft.EnterpriseManagement.CSVImport.CSVInstanceException' was thrown.

  • Hello Travis - I am onsite with large enterprise partners and looking at the process involved with importing multiple (hundreds) .rtf knowledge files.  Do you have a good overview of the process for staging the multiple .RTF files, .xml file or files, and are we talking about a single CSV file or multiple CSV files.  I am hoping to use powershell and the CSV-Import cmdlet to facilitate the process.  Any specific script and component staging info you have would be greatly helpful.  I have been cross referencing many forum posts and there is still some missing information around creating and managing and maintaining this process.  I look forward to your response.

  • @Michael -

    Its up to you whether you want to have multiple CSV files or just one big one.  You just need the one XML mapping file though.  

  • Thanks for the rapid reply Travis, I appreciate the response.  The last piece that I am missing is how to import multiple .RTF files into the Internal Content area in the General tab, and the Analyst Content on the Analyst tab for all the KAs being imported.  I can reference all the KAs by title and various properties in the CSV file and the structure in the .XML file but referencing the .RTF files is still a bit cryptic.  I did a CVS-export of all of the KA objects to look at the complete structure of the KA objects, in the EndUserContent and the AnalystContent for each KA in the CSV file the object referenced is Microsoft.EnterpriseManagement.Common.ServerBinaryStream.  It is unclear to me how I will reference the exact .RTF files for every KA.  For each KA I am importing I will have a specifically titled .RTF file for both EndUserContent and forAnalystContent.  I guess I need a deeper understanding of Microsoft.EnterpriseManagement.Common.ServerBinaryStream

    I was thinking that I would just have to reference the file titles and location for each KA-.RTF content match, and stage all the files in the appropriate folder location, but I do not see any way to do this.  Any insight you can provide would be greatly appreciated.  Thanks!  

  • @Michael - did you see Ander's blog post:

    http://contoso.se/blog/?p=1285

    In there he shows how the way you import the actual content is to specify a file location for the .rtf/.txt file for the  AnalystContent or EndUserContent field.

  • Thanks again Travis - Andreas didn't call it out specifically but spoke about the default location in the Server Manager folder - I just added the complete path to the .rtf file location and for the usercontent and anaylistcontent in the CSV file and that worked great.  the only thing I am seeing now is that none of the .rft images are getting pulled in... Any guidance here?