AnsweredAssumed Answered

I can't edit a license in SLM

Question asked by Samuel on Oct 23, 2018

Sometimes, a license cannot be saved anymore. This has happened to us a few times, specifically on Visual Studio licenses, not sure why.
I'm not sure exactly how that happened, but we found out what had happened.

In our case, one of the assignments for that license was pointing to an entity that does not exist anymore in SLM.

Example: A user was assigned a user license but he has been deleted in Snow because it has passed the quarantine/delete period.

I know that normally, deleting a user also removes the license assignments he had but, for some reason, we have some users that keep their license when deleted. That deletion is managed by the auto-quarantine/deletion management.

 

This can be fixed without having to delete and re-create the whole license, in the database itself. So I would recommend the following steps only if:

  1. You know what you are doing
  2. You feel comfortable querying your SLM database
  3. You prefer to avoid deleting and recreating the license

 

You can use this type of query to see what is the specific assignment that is wrong:

SELECT * FROM tblLicenseApplicationGrants lag
LEFT JOIN tblUser u ON u.UserID = lag.UserID
WHERE LicenseID = xxxxx
AND u.UserName IS NULL

It will give you the assignment records for License ID xxxxx that are incorrect and need to be deleted from the table tblLicenseApplicationGrants to fix the license.
The name of the users whose identity was removed from Snow can be inferred from comparing 2 lists of names: the query above (without the UserName IS NULL filter) with the following one:

SELECT Comment FROM tblLicenseAssignmentTracking
WHERE LicenseID = xxxxx

The fix can be made by deleting the record from tblLicenseAssignmentTracking and recreating a correct record manually in SLM since the license will then be fixed and able to be saved again.

DELETE FROM tblLicenseAssignmentTracking
WHERE LicenseID = xxxxx and UserID = yyyyy

 

 

 

I hope this helps

Outcomes