Anders strikes again – this time with a blog article about importing knowledge into Service Manager using CSV import.
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):
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:
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.
Any possible way to reference PDF files with this method Travis?
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.
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.
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:
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.
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:
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?