To get the machine name in which the user has logged on recently through sccm Report.it can be done by obtaining last logged user in a machine

it is possible for a multiple number of user and fetch their last logged on machine name .

This means that you can run this script, it'll prompt for a username, enter the username and it'll then bring back the computer of which the entered

username last logged into.

 

 

strSMSServer = "."
Set objLocator = CreateObject("WbemScripting.SWbemLocator")
name=Inputbox("enter username ")
Set objSCCM = objLocator.ConnectServer(strSMSServer, "root\sms")
Set Providers = objSCCM.ExecQuery("SELECT * From SMS_ProviderLocation WHERE ProviderForLocalSite = true")
For Each Provider in Providers
  If Provider.ProviderForLocalSite = True Then
    Set objSWbemServices = objLocator.ConnectServer(Provider.Machine, "root\sms\site_" & Provider.SiteCode)
  End If
Next
Set oResults     = objSWbemServices.ExecQuery("select * from SMS_R_System where LastLogonUserName = '"&name&"'")
For Each oResourceID In oResults
 wscript.echo oResourceID.Name

Next