sexta-feira, 11 de outubro de 2013

SCCM "Failed to Import Licensing Data into the Site Database" Ao importar informações do MVLS no Asset Inteligence Catalog

Olá Pessoal,

Essa semana tive que importar as informações do MVLS de um cliente no SCCM, e a principio o procedimento não deveria ter muito segredo, deveríamos exportas as informações do MVLS para um xml e importar no SCCM.

Procedimento explicado no TechNet pelo link: http://adf.ly/XMIcO

Porem, sempre que tentávamos fazer a importação, o erro abaixo era apresentado:


Verificando o arquivo xml com o bloco de notas você verá que os dados da coluna C, na maioria dos casos, estava com o tipo Number, conforme abaixo:

 
Porem, o correto para que o arquivo possa ser importado, precisa ser String conforme abaixo:
 
 


Isto acontece em todas as células onde a versão do produto esta somente com um valor apenas numérico (ex: 2005, 2008, 2012) em casos onde a versão possui letras também, o tipo da célula fica correto como String.
Isto acontece porque o Excel trata letras e números de maneiras diferentes.

Para resolver isso, encontrei três maneiras que seguem abaixo (Todas as três foram validadas e estão funcionando):

Método 1:
Mudar manualmente o campo da terceira coluna de cada conjunto dentro do XML, conforme abaixo:

 

Método 2:
Manualmente adicionar " ' " na frente de todos os campos numéricos da coluna C: no Excel:


Método 3 (Procedimento em Inglês):
Neste método iremos fazer o mesmo que no método 2, porem com uma macro que irá automatizar o processo:

1. Open .Xml file in Excel

2. Add Developer Tab on the Ribbon
a. Start the Office application (Word 2010, Excel 2010, Outlook 2010, or PowerPoint 2010).
b. Choose the File tab, and then choose Options.
c. In the categories pane, choose Customize Ribbon.
d. In the list of main tabs, choose Developer.
e. Choose the OK button to close the Options dialog box.
clip_image007
See How to: Show the Developer Tab on the Ribbon for more information: http://msdn.microsoft.com/en-us/library/bb608625.aspx

3. Now we need to run a VBA procedure to modify the Excel file. To do this, on the Developer tab, in the Code group, click Macro Security.

4. In the Macro Settings category, under Macro Settings, click Enable all macros (not recommended, potentially dangerous code can run), and then click OK.
Note: To help prevent potentially dangerous code from running, we recommend that you return to any one of the settings that disable all macros after you finish working with macros.

5. Save and close all open workbooks.

6. Open the workbook where you want to add the macro, or create a new workbook, and on the Developer tab, in the Code group, click Visual Basic(Alternatively you can press Alt+F11).

7. In the Project Explorer window, right-click the ThisWorkbook object, and then click View Code
For more details on this, see Run a macro at http://office.microsoft.com/en-us/excel-help/run-a-macro-HP010014113.aspx. Refer to section titled Create a VBA procedure for the Open event of a workbook

8. Copy in the code below (Note: You can change Collimit to number of rows you have in .XML file):

Sub test()
Dim s As String
Dim colname As String
colname = "C"
Dim collimit As Integer
collimit = 75
For i = 2 To collimit
s = colname & i
If Range(s).Value2 = "" Then
Else
Range(s).Value2 = "'" & Range(s).Value2
End If
Next
End Sub

It should look something like this:
clip_image009

9. Press F5 to Run Macro
clip_image010

10. Choose the File tab, Save .XML File(Ctrl+S)
clip_image011

11. Click Yes on the warning:
clip_image013

12. Verify each cell in column C (excluding the header) has the character ' before the data:
clip_image015



Fonte: http://adf.ly/XMFBi
Compartilhe este Post
  • Share to Facebook
  • Share to Twitter
  • Share to Google+
  • Share to Stumble Upon
  • Share to Evernote
  • Share to Blogger
  • Share to Email
  • Share to Yahoo Messenger
  • More...

 
© 2013 Manual da Informática - OLD
Desenvolvido por Manual da Informática
Posts RSSComments RSS
Back to top