Get-ADUser -identity username -properties *
get-aduser -filter * -properties passwordlastset, passwordneverexpires |ft Name, passwordlastset, Passwordneverexpires
get-aduser -filter * -properties passwordlastset, passwordneverexpires | sort name | ft Name, passwordlastset, Passwordneverexpires
For your results into excel use this:
Get-ADUser -filter * -properties passwordlastset, passwordneverexpires | sort-object name | select-object Name, passwordlastset, passwordneverexpires | Export-csv -path c:tempuser-password-info-20131119.csv
I was rebuilding my work’s Windows Server Update Services (WSUS) server the other day, and while configuring it I thought about how nice it would be to automate the cleanup process. You know, decline superseded updates, decline obsolete updates etc.
Normally one would have to do this manually by running the Server Cleanup Wizard, but who has time for that?
Well SpiceWorks community member Wouter-Trust created an awesome PowerShell script that works like a charm! You can find his post here and you can download his script here.
I have my script running once a week to free up disk space, and generally optimize our patch deployment process.
At my previous company we had a script that would get triggered on a domain controller if an Active Directory account got locked out because of too many login attempts. It was really helpful in being proactive when someone got locked out.
I decided my current company needed something like that too, and I found a really easy Powershell script that did the trick. You can download that script here (AD Lockout Alert Script) then do the following on your domain controller to send out the alerts:
- Open Powershell on your domain controller and run the following to allow the execution of scripts: