Skip to content
Marco van Gaal edited this page Aug 5, 2015 · 4 revisions

.NAME

Get-ADStale

.SYNOPSIS

.PARAMETERS

 -Computers [<SwitchParameter>]
     Return Computer objects
     
     Required?                    true
     Position?                    named
     Default value                False
     Accept pipeline input?       false
     Accept wildcard characters?  false
     
 
 -Users [<SwitchParameter>]
     Return User objects
     
     Required?                    true
     Position?                    named
     Default value                False
     Accept pipeline input?       false
     Accept wildcard characters?  false
     
 
 -Age <Int32>
     Specifies date in history in days
     
     Required?                    false
     Position?                    1
     Default value                90
     Accept pipeline input?       false
     Accept wildcard characters?  false
     
 
 -Force [<SwitchParameter>]
     
     Required?                    false
     Position?                    named
     Default value                False
     Accept pipeline input?       false
     Accept wildcard characters?  false

.INPUTS

None.

.OUTPUTS

.NOTES

 www.proxx.nl

.EXAMPLES

 -------------------------- EXAMPLE 1 --------------------------
 
 PS C:\>Get-ADStale -Users -Age 365
 
 
 
 
 
 
 
 
 
 -------------------------- EXAMPLE 2 --------------------------
 
 PS C:\>Get-ADStale -Users -Age 365 | Out-GridView -PassThru | Disable-ADAccount -WhatIf
 
 
 
 This wil get all stale user objects from active directory and display them in
 a gridview when pressed ok in the gridview the accounts wil be disabled.
 
 
 
 
 
 -------------------------- EXAMPLE 3 --------------------------
 
 PS C:\>Get-ADStale -Computers -Age 365 | Out-GridView -PassThru | Remove-ADComputer -WhatIf
 
 
 
 This wil get all stale computer objects from active directory and display them in
 a gridview when pressed ok the computer object will be removed from active directory.

.RELATED LINKS

www.proxx.nl/Wiki/Get-ADStale/

Clone this wiki locally