Scripting Blog

A place to learn about PowerShell and share stories of automation

PowerTip: Use PowerShell to Work with Active Directory Date Fields

Summary: Use Windows PowerShell to work with Active Directory date fields.  How can I Use Windows PowerShell to work with date fields in Active Directory?  Try the following techniques: # Password last set within the last 30 days? $pwdLastSet = Get-ADUser Administrator -Properties pwdLastSet |      Select-...

Active Directory Week: Stale Object Cleanup Guidance—Part 2

Summary: Scripting tips for cleaning up stale Active Directory accounts. Microsoft Scripting Guy, Ed Wilson, is here. Today we continue our series about Active Directory PowerShell by Ashley McGlone. Before you begin, you might enjoy reading these posts from the series: See yesterday’s post for a discussion and guidance about stale...

PowerTip: Use PowerShell to Get Inactive Active Directory Accounts

Summary: Use Windows PowerShell to get a report of inactive Active Directory accounts.How can I use Windows PowerShell to get a report of inactive Active Directory accounts?The Search-ADAccount cmdlet has a number of parameters and switches to help identify stale accounts: You can also use the -UsersOnly or&...

Active Directory Week: Stale Object Cleanup Guidance—Part 1

Summary: Learn about how to clean up stale Active Directory accounts. Microsoft Scripting Guy, Ed Wilson, is here. Today we continue our series about Active Directory PowerShell by Ashley McGlone. Before you begin, you might enjoy reading his first two posts: Here's Ashley... In the United States, this week we celebrate Thanksgiving. ...