Solved

Powershell script

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

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

In this previous article (https://oddytee.wordpress.com/2016/05/05/provision-new-office-365-user-and-mailbox-from-exchange-hybrid-via-powershell/), we made basic license assignments to users in O365. When I say basic, the method is the simplest way …
This article will help you understand what HashTables are and how to use them in PowerShell.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

708 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

19 Experts available now in Live!

Get 1:1 Help Now