Posted On March 29, 2019

Last Logon Dates of List of AD Accounts

kimconnect 0 comments
blog.KimConnect.com >> Codes , Windows >> Last Logon Dates of List of AD Accounts
import-module activedirectory
$output=""

Get-Content C:\Users\kimconnect\Desktop\targetAccounts.txt | Foreach-Object -Process{
#  cast an array object as string before using string operations
  $output+=$_+": "+([string](Get-ADUser $_ -Properties * | Select lastLogonDate) -replace "@{lastLogonDate=*" -replace "}") + "`n"
}
$output

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

Small Call Center BPX Capacity Planning

Requirements: 20+ users ~ 40000 minutes Recurring cost to be less than $1000 per month?…

NUMLOCK windows XP

Go to Start>> Run. Type in: regedit [Enter] or click OK. Navigate to the following…

Remove Bloatware on a Windows 10 Default Installation

1. Run PowerShell as Administrator 2. Issue these commands to download the Windows10Debloater script: #…
Other project: DragonCoin.com