Solved

Powershell script

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
A procedure for exporting installed hotfix details of remote computers using powershell
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

863 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now