Looking for a way to get a report of the users by their actually Username.
Select server reports by machine name only.
Thanks for any help
there is Get-PWMonthlyLogins. use -Month to specify what month you are interested in.
the get a report of the datasource, username and email address of users that logged in the previous month:
Get-PWMonthlyLogins -Month (Get-Date).AddMonths(-1).Month | select Datasource,UserName,useremail
But we use the hosted selectserver and the Passport Cumulative Usage report shows usernames. As does the User Report > Monthly Usage by User.
I'm getting a error, here is my command line. I have logged into the datasource
Get-PWMonthlyLogins -March (Get-Date).AddMonths(-1).Month | select Datasource,UserName,useremail
Here is the error
Get-PWMonthlyLogins : A parameter cannot be found that matches parameter name 'March'.At line:1 char:21+ Get-PWMonthlyLogins -March (Get-Date).AddMonths(-1).Month | select Da ...+ ~~~~~~ + CategoryInfo : InvalidArgument: (:) [Get-PWMonthlyLogins], ParameterBindingException + FullyQualifiedErrorId : NamedParameterNotFound,PWPS_DAB.GetPWMonthlyLogins
LARRY WILSON | Senior Designer Crawford, Murphy & Tilly | Engineers & Consultants 84 Remick Blvd. | Springboro, OH 45066 email@example.com
okay, misunderstood you. So how do you specify a certain month?
I ran the command exactly like you have it, and didn't get an error, but also didn't get any report.
Got the report, how do you specify the month or is just the month you are in?
One more question, is there a way to just get the logical logins only?
-Month takes a number after it for the month login, there is also a -Year to specify the year. I included code to get the month from the current month.
The users that are returned by the command have a property UserType that identify if they are a windows account (UserType W) or Logical account (UserType D (I don't understand why D))
So to get a list of logical users that logged in march of this year:
$users = Get-PWMonthlyLogins -Month 3 -Year 2019 | Where UserType -eq "D"
write-host "$(Users.Count) users logged in"
$users | Select Datasource,UserName,UserDescription,UserEmail
change -Month to -Month 2 for Feburary. Change to -Month 11 -Year 2018 for November of 2018
Answer Verified By: Larry Wilson