Solved

Powershell script

Posted on 2016-11-18
3
76 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 5

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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

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…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
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…

734 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