Door deze site te gebruiken, u gaat akkoord met de Privacybeleid.
Accepteren
OndernemingOndernemingOnderneming
  • THUIS
  • IT-PRO
  • Technisch
  • Microsoft
    • Azuur
    • Configmgr/sccm
    • DPM
    • Orkestrator
    • Hyper-V
    • Microsoft Edge Insider
    • MSI
    • Kantoor 365
    • Kantoor insider
    • PowerBI
    • Skypen
    • SQL-server
    • Teams
  • VENSTERS
    • Windows-beheercentrum
    • Windows-client
    • Windows-server
  • SCCM-queryverzamelingslijst
Lezing: How to Find Inactive Computers in Active Directory using PowerShell
Lettergrootte wijzigenAa
OndernemingOnderneming
Lettergrootte wijzigenAa
  • THUIS
  • IT-PRO
  • Technisch
  • Microsoft
  • VENSTERS
  • SCCM-queryverzamelingslijst
Zoekopdracht
  • THUIS
  • IT-PRO
  • Technisch
  • Microsoft
    • Azuur
    • Configmgr/sccm
    • DPM
    • Orkestrator
    • Hyper-V
    • Microsoft Edge Insider
    • MSI
    • Kantoor 365
    • Kantoor insider
    • PowerBI
    • Skypen
    • SQL-server
    • Teams
  • VENSTERS
    • Windows-beheercentrum
    • Windows-client
    • Windows-server
  • SCCM-queryverzamelingslijst
Het pro

How to Find Inactive Computers in Active Directory using PowerShell

Gepubliceerd: Februari 11, 2024
1 Min. gelezen
DEEL

How to Find Inactive Computers in Active Directory using PowerShell.

To identify inactive computer accounts, you will always target those that have not logged on to Active Directory in the last 90 dagen. To accomplish this goal, you need to target theLastLogonTimeStamp property and then specify a condition with the time as shown in the following PowerShell commands:

$DaysInactive = 90

$time = (Get-Date).Adddays(-($DaysInactive))

Get-ADComputer -Filter {LastLogonTimeStamp -lt $time} -ResultPageSize 2000 -resultSetSize $null -Properties Name, OperatingSystem, SamAccountName, DistinguishedName

If you wish to search computer accounts that have been inactive for more than 90 dagen, all you need to do is modify the$DaysInActive variable value. The current value is set at 90 dagen; however, you can specify your own value.

To export output to a CSV file, add theExport-CSV PowerShell cmdlet as shown in the following command:

Get-ADComputer -Filter {LastLogonTimeStamp -lt $time} -ResultPageSize 2000 -resultSetSize $null -Properties Name, OperatingSystem, SamAccountName, DistinguishedName | Export-CSV "C:\Temp\StaleComps.CSV" –NoTypeInformation
GETAGD:Active DirectoryMicrosoft Windows-serverPowershellRamen
Vorig artikel Configuration Manager Queryverzamelingslijst Configuration Manager Scan failed with error 0x80244022
Volgend artikel Windows Admin Center Preview 1812 released
2 Opmerkingen 2 Opmerkingen
  • fernan zegt:
    Januari 13, 2022 bij 4:05 ben

    ¿Porqué me devuelve en algunas cuentas Enabled: True?

    Antwoord
    • Andrej Nadak zegt:
      Januari 13, 2022 bij 6:09 ben

      Hoi. Can you add any screenshots for this?

      Antwoord

Laat een antwoord achter Antwoord annuleren

Uw e-mailadres wordt niet gepubliceerd. Verplichte velden zijn gemarkeerd *

Deze site gebruikt Akismet om spam te verminderen. Ontdek hoe uw reactiegegevens worden verwerkt.

Vertaling

English中文(简体)DanskNederlandsFrançaisDeutschItaliano한국어PolskiPortuguêsRomânăEspañolУкраїнська
door Transposh - Vertaalplugin voor Wordpress

Populaire berichten

Systeemvereisten voor Windows Server 2016
Windows-server
Configuration Manager Queryverzamelingslijst
Configuration Manager Queryverzamelingslijst
ConfiguratieMgr
Gestructureerde/beheerde navigatie ingeschakeld op moderne pagina's in klassieke teamsites
Technologie
SCCM Kan DP-locaties niet ophalen als de verwachte versie van MP
ConfiguratieMgr

Recente berichten

Fail2ban installeren en configureren voor SSH-bescherming op Ubuntu 24.04
Linux
FirewallD inschakelen en configureren op AlmaLinux
Linux
Gebruikers aanmaken en SSH-sleutel instellen in AlmaLinux
Linux
Hoe het wachtwoord op AlmaLinux opnieuw in te stellen
Linux

© 2023 Onderneming

Ga naar mobiele versie
Welkom terug!

Log in op uw account

Gebruikersnaam of e-mailadres
Wachtwoord

Wachtwoord vergeten?