Any way to see when Named Users last logged in?

I recently hit my 50 named user licence limit. “Well buy some more then!” I hear you cry, however, most of these users will not be back, having logged on for training but with the main responsilibilty of configuring Squared Up falling on one or two key people in their respective teams.

It’d be useful to know who is ‘best’ to remove (and thus free up a licence for someone else), based on last login. Is this exposed in a log file anywhere?

2 Likes

Have a look in the iis logs.

C:\inetpub\logs\LogFiles\W3SVC1

You can pick out usernames from there and last access times. Bit ugly, but you could use software such as Log Parser to analyze usernames.

https://www.microsoft.com/en-us/download/details.aspx?id=24659

3 Likes

I assume when you bin off a Named User and they log in again with a new licence, that they keep their profile and draft dashboards intact? (I’m being lazy here, I will test).

An existing user login will enter the log file as:

[INF] “USER.DOMAIN” lease result NewUserAndLease

And when they log out:

[INF] Release of lease for “SCOMADMIN.DOMAIN”

Each time a new user logs in, an entry is created in the log file.

[INF] “SCOMADMIN.DOMAIN” lease result NewUserAndLease yielding Lease

 

I’m aware that some customers monitoring Squared Up and pull this data out, along with other info. The log is located here: C:\inetpub\wwwroot\squaredupv3\transient\log

That being said, a feature request to support is probably a good shout - This could be very useful for both small and large environments.

From Jellys info I created a powershell script to get all the logins:

 

cd C:\inetpub\wwwroot\squaredupv3\transient\log
#if it is located in that folder otherwise change the path. Mine was under the squaredup installation
# on another disk (d:).

$a = Get-ChildItem -Recurse -Include *.* | where-object {$_.creationtime -gt (get-date).adddays(-30)} | Select-String "lease result NewUserAndLease"
# gets only the files created the last 30 days. modify for greater scope
# $a gives all the rows containing a login from a user.


$pattern = [regex] '(?is)(?<=\bINF\b).*?(?=\blease\b)'
#Pattern that picks up the username of the user
$a | Foreach {if ([Regex]::IsMatch($_, $pattern)) {
           $found = [Regex]::Match($_, $pattern)
        write-host $found
            }
        }
# loops and prints all the user that has logged in.
# You can take that data and then do a unique on that if you want to make it easier to read.
4 Likes

@Squaredup… Feature request :slight_smile:

I did a check with procmon. But no files are changed connected to the user profile when a user logs in except for the logs as you state.

Not an elegant solution I’m afraid, but you could ‘clear out’ your current named users (except those you KNOW are going to be active) and then anyone actively looking to use Squared Up will log-in and have a free license automatically assigned to them. As I say, not very elegant , but it might be one way of effectively removing the people who had a license assigned to them for training but won’t be using it thereafter (as only the active people will log in again and take a license from the pool).