filmov
tv
Get a list of Disabled Users in Active Directory using PowerShell
Показать описание
Learn how to retrieve a list of disabled users in Active Directory using PowerShell. Managing user accounts in Active Directory involves various tasks, including enabling, disabling, and monitoring user activity. Retrieving a list of disabled users is crucial for security, auditing, or cleaning up inactive accounts. Follow this step-by-step guide to easily obtain the list using PowerShell.
Chapters
*********
00:00 - Intro
00:12 - Prerequisites
00:19 - Using Get-ADUser
01:47 - Using Search-ADAccount
02:11 - Outro
Use the Get-ADUser cmdlet to retrieve a list of disabled users by running the following command
***********************************************************************************************
Get-ADUser -Filter {Enabled -eq $false} -Properties * | Select-Object Name, GivenName, Surname, SamAccountName, UserPrincipalName, DistinguishedName, LastLogonDate
To save the list of disabled users for analysis or reporting, export it to a CSV file using the Export-Csv cmdlet
***********************************************************************************************
You can also use the Search-ADAccount cmdlet to list disabled users. This can be done by using the -AccountDisabled parameter to search for disabled accounts, and the -UserOnly parameter to search only for users.
**********************************************************************************************
Search-ADAccount –AccountDisabled –UsersOnly | Select-Object SamAccountName, DistinguishedName
Chapters
*********
00:00 - Intro
00:12 - Prerequisites
00:19 - Using Get-ADUser
01:47 - Using Search-ADAccount
02:11 - Outro
Use the Get-ADUser cmdlet to retrieve a list of disabled users by running the following command
***********************************************************************************************
Get-ADUser -Filter {Enabled -eq $false} -Properties * | Select-Object Name, GivenName, Surname, SamAccountName, UserPrincipalName, DistinguishedName, LastLogonDate
To save the list of disabled users for analysis or reporting, export it to a CSV file using the Export-Csv cmdlet
***********************************************************************************************
You can also use the Search-ADAccount cmdlet to list disabled users. This can be done by using the -AccountDisabled parameter to search for disabled accounts, and the -UserOnly parameter to search only for users.
**********************************************************************************************
Search-ADAccount –AccountDisabled –UsersOnly | Select-Object SamAccountName, DistinguishedName