Symantec Management Platform (Notification Server)

 View Only
  • 1.  ASDK Error Guid should contain 32 digits with 4 dashes

    Posted May 04, 2013 12:45 AM

     

    I have an odd issue with the ASDK I'm wondering if anyone else has seen.  Essentially I'm getting a "Altiris.ASDK.NS.COM: Method failed. Exception: Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)." message from a script.  The SMP I'm running it on has SMP 7.1 SP2 MR1.1 installed witht the full ITMS suite.
     
    This example script, run on the SMP, in an elevated cmd prompt with the appid account.
    '=======================================================================
    set reportManagement = CreateObject("Altiris.ASDK.NS.ReportManagement")
    set itemManagement = CreateObject("Altiris.ASDK.NS.ItemManagement")
     
    reportManagement.TargetServer = "localhost"
    reportManagement.Authenticate()
    itemManagement.TargetServer = "localhost"
    itemManagement.Authenticate()
     
    reportGuid = "{1f382791-b2cf-4b39-afd3-28348693c44e}"
     
    set itemObject = itemManagement.GetItemByGuid(reportGuid)
    wscript.echo itemObject.Name & " : " & itemObject.Guid
    wscript.echo itemObject.TypeName
    set results = reportManagement.RunReport(itemObject.Guid)
    '=======================================================================
    Results in this message:
    C:\Temp>cscript Test.vbs
    Microsoft (R) Windows Script Host Version 5.8
    Copyright (C) Microsoft Corporation. All rights reserved.
     
    All Assets : 1f382791-b2cf-4b39-afd3-28348693c44e
    ReportManagementItem
    C:\Temp\Test.vbs(15, 1) Altiris.ASDK.NS.COM: Method failed. Exception: Guid shou
    ld contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).
     
    But the guid provided does meet the 32 digit and 4 dash criteria.  The GetItemBy guid method for itemmanagement uses it fine but the reportmanagement class does not.  My original test used reportManagement.RunReport(reportGuid) with the same result.  I also get the same result running remotely (with the installation of the asdk and adding credentials to the script).
     
    The example above is really just an expansion of the example given in the asdk help file.


  • 2.  RE: ASDK Error Guid should contain 32 digits with 4 dashes

    Posted May 05, 2013 02:20 PM

    According to the documentation for the RunReport method, "The COM and CLI layers take and return guids represented as strings."

    Have you tried?

    reportGuid = "1f382791-b2cf-4b39-afd3-28348693c44e"
    set results = reportManagement.RunReport(reportGuid)

     



  • 3.  RE: ASDK Error Guid should contain 32 digits with 4 dashes

    Posted May 06, 2013 04:23 AM

    Thanks for the response.  I get the same result whether I use a string or the guid property from the item object.  I tried the Item object just to demonstrate it was working for a different object class.

    For example this script:

     

    '=======================================================================
    set reportManagement = CreateObject("Altiris.ASDK.NS.ReportManagement")
     
    reportManagement.TargetServer = "localhost"
    reportManagement.Authenticate()
     
    reportGuid = "1f382791-b2cf-4b39-afd3-28348693c44e"
    wscript.echo reportguid
    set results = reportManagement.RunReport(reportguid)
    '=======================================================================
     
    returns:
    C:\Temp>cscript test2.vbs
    Microsoft (R) Windows Script Host Version 5.8
    Copyright (C) Microsoft Corporation. All rights reserved.
     
    1f382791-b2cf-4b39-afd3-28348693c44e
    C:\Temp\test2.vbs(9, 1) Altiris.ASDK.NS.COM: Method failed. Exception: Guid shou
    ld contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).
     
     
     
    If I try the CLI it works fine.  Its almost like the Altiris.ASDK.NS.ReportManagement object is damaged in some way.  Whether its the code or a bug on my server I don't know.
     
    I've tried uninstalling/re-installing the asdk and repairing the whole ITMS solution with the SIM with no change.

    The server is 100% patched up to date via Windows Update.



  • 4.  RE: ASDK Error Guid should contain 32 digits with 4 dashes

    Posted May 06, 2013 08:49 PM

    I ran the code on my own server and got the same error message. So I tried using the method to call a different report.

    '=======================================================================
    
    set reportManagement = CreateObject("Altiris.ASDK.NS.ReportManagement")
    
    
    reportManagement.TargetServer = "localhost"
    
    reportManagement.Authenticate()
    
    
    reportGuid = "0535D3CF-A809-4159-B915-04748ECE3142" 'Agent Version report
    
    wscript.echo reportguid
    
    set results = reportManagement.RunReport(reportguid)
    
    '=======================================================================

    This did not report an error, so I suspect that there is something about the All Assets report which is causing the issue. I have not had time to investigate further.



  • 5.  RE: ASDK Error Guid should contain 32 digits with 4 dashes

    Posted May 06, 2013 09:27 PM

    You're right that report does run ok for me too.

    The All Assets-Simple report (4223d4e6-74cf-496f-adf0-5f1c9549fc42) also works ok, as did another custom report I wrote.

    Thats good progress though - thanks!.  I'll take more of a look at it later today.

     



  • 6.  RE: ASDK Error Guid should contain 32 digits with 4 dashes

    Posted May 07, 2013 05:00 AM

    To update this, if I use "cast" on all guid fields as varchar(36) then affected reports can be successfully called with the RunReport method.