If LFDS is configured to sync from AD groups, is there a way to have it send a notification when the number of available licenses reaches a certain threshold or when they run out?
Question
Question
Notification when Named User Licenses running low
Answer
Interesting idea, thank you for sharing! I've noted it for consideration and linked back to this post so we can update here if the feature goes to development.
If you want to set this up your own, you use SQL tools to trigger emails based off of the number of assigned licenses. I don't think there's a simple way to query for the total available number of licenses in SQL (so you might have to code that value in), but you can get a lot of information on what licenses are assigned.
For example,
SELECT count([type]) FROM [LFDS_Release104].[dbo].[user_licenses] where [type] ='9bba0d89-9a13-455f-ada9-83cf071d46b9'
will return the number of full named user licenses (that's the 9bba[...] guid in the "type" column) assigned to users. Make sure not to modify the licensing database if you try this out!
Replies
Has there been any progress/decisions on this feature? This is something we are trying to monitor as well.
Another request for an update on this. That DB query is a good starting point but doesn't include things like licenses assigned to a specific LF Server or organization. And as Brianna mentioned, it doesn't count total licenses (though I can get that through LMO).
Basically, I want to be able to see the count of full licenses that shows on the main overview page of LFDS. And then give you more money when that number gets too low.
Hey @████████ any thoughts on this one? Basically, I want to create a report that will give me the same view as the LFDS counter.
Hey Pieter,
I spent a while on this and figured out how to automatically generate the same CSV report you get by clicking this button:
This PowerShell script gets you the data in CSV format. You can then use the data to generate whatever metrics and alerts you want. I trust you could figure out how to adapt it for a Workflow web request or similar if desired to meet your needs.
# PowerShell ### Parameters # The server name as it appears in the LFDS web admin URL (https://localhost/LFDS/#!/SERVER/database) $lfdsServer = 'server' # The licensing site (database) name as it appears in the LFDS web admin URL (https://localhost/LFDS/#!/server/DATABASE) $lfdsDatabase = 'database' $reportFormat = 'csv' # The FQDN you reach LFDS web admin at; NO trailing slash; must have valid TLS certificate bound $lfdsBaseURL = "https://lfds.example.com/LFDS" $reportURI = "/specificapi/Report/GenerateResourceUsageReport?server=$($lfdsServer)&dbname=$($lfdsDatabase)&reportFormat=$($reportFormat)" $uri = $lfdsBaseURL + $reportURI # The directory you want to store the report files in $path = 'C:\Reports\' $filename = "LFDS-LicenseUsageReport-$(Get-Date -f yyyy-MM-dd).csv" $outFile = Join-Path -Path $path -ChildPath $filename ### Path validation if (!(Test-Path -Path $path)) { New-Item -ItemType Directory -Force -Path $path } ### Report generation # LFDS requires WinAuth to access report generation. -UseDefaultCredentials passes the current user's AD credentials. $Response = Invoke-RestMethod -Uri $uri -UseDefaultCredentials $Response.value | Out-File $outFile -Encoding ASCII
Sample output file attached with a .txt extension appended because Answers forgot to put .csv on the allowlist.
Thanks, Sam. You're the man!
Hey Sam-
I wanted to run all the logic form within Workflow, and from threads on here, running a PS1 script from WF seems problematic. So I converted the web call in that script to a WF web call, write the output to a known CSV path, then query that CSV and compare counts. Probably could skip the data steps if I was better with c#, but I think this will work quite well for my needs.
Thanks again for the assist!
Welcome! If you're going that route, I might suggest writing out the results to a database table with an additional date/timestamp column and querying that instead. It would make it easy to generate historical license usage reports as well if those might ever be useful. And/or hook up to a dashboard in the BI tool of your choice.