Solved

Powershell script

Posted on 2016-11-18
3
84 Views
Last Modified: 2016-11-22
I need a PowerShell script that list all users that have not log in to the Domain for the past 30/90 days and I need to print this list, I'm new to PowerShell can someone help? I will really appreciate any help
0
Comment
Question by:FCHCAdmin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 6

Assisted Solution

by:Austin Texas
Austin Texas earned 250 total points
ID: 41893734
This expert suggested creating a Gigs project.
You could use this command:
Search-ADAccount -AccountInactive -TimeSpan 30 -UsersOnly | Where-Object { $_.Enabled -eq $true } | Format-Table Name, UserPrincipalName

Open in new window

Here is a sample script that you could start with: https://gallery.technet.microsoft.com/scriptcenter/Export-Last-Logon-Times-4fcb07cb
0
 
LVL 3

Accepted Solution

by:
Ed Dredd earned 250 total points
ID: 41894540
Get-ADUser -filter * -properties LastLogonDate`
| sort-object name | select-object Name, LastLogonDate `
| Export-csv -path c:\user-LastLogonDate.csv
0
 

Author Comment

by:FCHCAdmin
ID: 41897914
Thank you all.
0

Featured Post

Ready to trade in that old firewall?

Whether you need to trade-up to a shiny new Firebox or just ready to upgrade from whatever appliance you're using now, WatchGuard has the right appliance for you! Find your perfect Firebox today with appliance sizing tool!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

635 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question