Utilizzando questo sito, accetti il politica sulla riservatezza.
Accettare
EnterineEnterineEnterine
  • CASA
  • PROFESSIONISTA
  • TECNICA
  • Microsoft
    • Azzurro
    • ConfigMgr/SCCM
    • Dpm
    • Orchestratore
    • Hyper-V
    • Microsoft Edge Insider
    • MSI
    • Ufficio 365
    • Insider dell'ufficio
    • Potenza BI
    • Skype
    • SQLServer
    • Squadre
  • FINESTRE
    • Centro di amministrazione di Windows
    • Cliente Windows
    • Windows Server
  • Elenco raccolte query SCCM
Lettura: How to Find Inactive Computers in Active Directory using PowerShell
Ridimensionamento dei caratteriAa
EnterineEnterine
Ridimensionamento dei caratteriAa
  • CASA
  • PROFESSIONISTA
  • TECNICA
  • Microsoft
  • FINESTRE
  • Elenco raccolte query SCCM
Ricerca
  • CASA
  • PROFESSIONISTA
  • TECNICA
  • Microsoft
    • Azzurro
    • ConfigMgr/SCCM
    • Dpm
    • Orchestratore
    • Hyper-V
    • Microsoft Edge Insider
    • MSI
    • Ufficio 365
    • Insider dell'ufficio
    • Potenza BI
    • Skype
    • SQLServer
    • Squadre
  • FINESTRE
    • Centro di amministrazione di Windows
    • Cliente Windows
    • Windows Server
  • Elenco raccolte query SCCM
Professionista informatico

How to Find Inactive Computers in Active Directory using PowerShell

Pubblicato: Febbraio 11, 2024
1 Lettura minima
CONDIVIDERE

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 giorni. 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 giorni, all you need to do is modify the$DaysInActive variable value. The current value is set at 90 giorni; 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
TAGGATO:Directory attivaMicrosoft Windows ServerPowershellFinestre
Articolo precedente Elenco raccolte query di Gestione configurazione Configuration Manager Scan failed with error 0x80244022
Articolo successivo Windows Admin Center Preview 1812 rilasciato
2 Commenti 2 Commenti
  • fernan dice:
    Gennaio 13, 2022 A 4:05 Sono

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

    Rispondere
    • Andrej Prijmak dice:
      Gennaio 13, 2022 A 6:09 Sono

      Hi. Can you add any screenshots for this?

      Rispondere

Lascia una risposta Annulla risposta

Il tuo indirizzo email non verrà pubblicato. I campi obbligatori sono contrassegnati *

Questo sito utilizza Akismet per ridurre lo spam. Scopri come vengono elaborati i dati dei tuoi commenti.

Traduzione

English中文(简体)DanskNederlandsFrançaisDeutschItaliano한국어PolskiPortuguêsRomânăEspañolУкраїнська
di Transposh - plugin di traduzione per wordpress

Post popolari

Requisiti di sistema per Windows Server 2016
Windows Server
Elenco raccolte query di Gestione configurazione
Elenco raccolte query di Gestione configurazione
ConfigMgr
Navigazione strutturata/gestita abilitata nelle pagine moderne nei siti del team classici
Tecnologia
SCCM Impossibile ottenere le posizioni DP come versione prevista da MP
ConfigMgr

Post recenti

Installazione e configurazione di Fail2ban per la protezione SSH su Ubuntu 24.04
Linux
Abilitazione e configurazione di FirewallD su AlmaLinux
Linux
Creazione utente e configurazione chiave SSH in AlmaLinux
Linux
Come reimpostare la password su AlmaLinux
Linux

© 2023 Enterine

Vai alla versione mobile
Bentornato!

Accedi al tuo account

Nome utente o indirizzo e-mail
Password

Hai perso la password?