-
Notifications
You must be signed in to change notification settings - Fork 0
Get ADStale
Marco van Gaal edited this page Aug 5, 2015
·
4 revisions
Get-ADStale
-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
None.
www.proxx.nl
-------------------------- 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.