Hinweis
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, sich anzumelden oder das Verzeichnis zu wechseln.
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, das Verzeichnis zu wechseln.
Applies To: Windows Server 2008 R2
This topic explains how to use the Active Directory module for Windows PowerShell to find inactive or unused computers.
Example
The following example is a sample script for finding inactive or unused computers in the Fabrikam.com domain:
$lastSetdate = [DateTime]::Now - [TimeSpan]::Parse("45")
Get-ADComputer -Filter {PasswordLastSet -le $lastSetdate} -Properties passwordLastSet -ResultSetSize $null | FT samaccountname,PasswordLastSet
A script is a series of Active Directory PowerShell cmdlets. For more information about running Active Directory PowerShell scripts, see Running Windows PowerShell Scripts (https://go.microsoft.com/fwlink/?LinkID=119588).
Additional information
For a full explanation of the parameters that you can pass to Get-ADComputer, at the Active Directory module command prompt, type Get-Help Get-ADComputer –detailed, and then press ENTER.