Powershell - List all logged in users

jamiegf used Ask the Experts™
I need a powershell script to show all interactive logins to a server in a list and also specify the amount of days to search for.
(So the list will just tell me which users logged into a server over say the last 30 days)
The servers are Windows 2016.
 Id like to be able to change / filter the login type (as i will initially be using logon type 2 and 7 etc) if this is possible?

Thanks very much.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Senior Infrastructure Analyst

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial