How can i get the user names who belong to devices to whom cal license is assigned

Rohit Boddu 466 Reputation points
2020-10-28T13:24:39.16+00:00

Hi,

I have generated a cal report but in that i can see just the devices to whom cal license is assigned .. Please see the attched screenshot .. but i want to find the user who belongs to those devices ..

35781-powershell.png

So now i want to find the users who belong to those devices to whom cal is assigned ..

Please tell me how can i accomplish this..

Regards,
Rohit.

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,512 questions
0 comments No comments
{count} votes

Accepted answer
  1. Rich Matheisen 46,561 Reputation points
    2020-10-29T14:37:02.307+00:00

    How about something simple then?

    $date = (get-date).AddDays(-30)
    
    $Params = @{
        Filter      = "Enabled = $true -and LastLogonDate -lt $date"
        Properties  = "LastLogonDate"
    }
    $Props          = "Name","LastLogonDate","'DistinguishedName"
    
    $Inactive       = Get-Aduser @Params | Select-Object $Props
    

    Keep in mind that the LastLogonDate isn't replicated immediately between DCs. The replication happens at a random time between 9 and 14 days. You may not find all the users on the first pass, but you'll find them eventually.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Rich Matheisen 46,561 Reputation points
    2020-10-28T14:51:14.553+00:00

    RDS Per Device CALs aren't issued to users, they're issued to machines. Any number of users may use the machine, but only the number of machines currently licensed may use RDS concurrently.

    So, the question is what users are you interested in? The currently logged on user? Any user that used the client, currently or in the past?

    The Security Event Log would record each logon. The event would have the user name and the machine name.

    The registry on the client would have the user profile names, and the Security Event Log on the client would also record the user that logged on to it (but not the use of RDS).

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.