chocolatey / chocolatey-licensed-issues

Issues for Licensed Editions of Chocolatey
19 stars 13 forks source link

API - GetComputerForView method result missing creationTime #321

Closed threechord82 closed 1 year ago

threechord82 commented 1 year ago

After the upgrade to CCM 0.10 the API seems to be missing the creationTime. This was used by us to create an overview of the last newly registered computers.

Unfortunately I can't find any other API where a creationTime is available to read out the first registration time.

Additional Context.

    $params = @{
        Uri        = "https://$CCmServerHostname/api/services/app/Computers/GetComputerForView?id=$ID"
        Method     = 'GET'
        WebSession = $Session
    }
    $GetComputerForView = Invoke-RestMethod @params 
    $GetComputerForView.result.creationTime

Up to version 0.9 the API still returned the time when a computer first reported to the CCM. With version 0.10 this possibility is unfortunately no longer available.

┆Issue is synchronized with this Gitlab issue by Unito ┆Milestone: 0.10.1

gep13 commented 1 year ago

@threechord82 thank you for taking the time to raise this issue, and apologies for this inconvenience!

In the release notes for CCM 0.10.0, you will find this entry:

  • Fix - Auditing data may be lost in the database when some entries are updated.
    • Editing a Group, Software, or Computer would erase the user who created it and the time it was created. As part of this fix, entries without that information will set the creating user to the user who last modified it.

During testing, we found that important audit information, for example, the CreationTime of an entity was being overwritten each time the entity was being updated. In the case of the Computer Entity, this would have been each time the computer reported into CCM.

In "fixing" this issue, the audit information that you were making use of, i.e. the CreationTime was removed from the API call that you are using.

I have discussed this with the team, and we agree that this is something that we should address, it is just a case of getting this released planned so that we can roll out the fix.

I wish that I could say that there is a workaround that you can use in the interim, but this isn't the case.

Please let me know if you have any questions.