0

PowerShell AD User to find out last time a password changed

Get-ADUser -identity username -properties *

PasswordLastSet andPasswordNeverExpires.

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

 

 

 

0

PowerShell Script to clean up WSUS

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.
<–more!–>
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.