Ищем источник блокировки учетной записи пользователя в active directory

PowerShell Get All Users Password Expiration Date

  1. Copy and paste the script below:

    Get-ADUser -filter {Enabled -eq $True -and PasswordNeverExpires -eq $False} –Properties "DisplayName", "msDS-UserPasswordExpiryTimeComputed" |
    Select-Object -Property "Displayname",@{Name="ExpiryDate";Expression={[datetime]::FromFileTime($_."msDS-UserPasswordExpiryTimeComputed")}}
  2. Export the list:

    To export the list add this to the end of the command.

    export-csv -path c:\temp\passwordexpiration.csv

Option #2 AD Reporting Tool

In this example, I’ll use the AD Reporting Tool that is included in the AD Pro Toolkit. The toolkit includes over 200 built-in reports.

Ищем источник блокировки учетной записи пользователя в active directory

Step 2. To export the list click the export button.

Ищем источник блокировки учетной записи пользователя в active directory

How to Check Password Expiration Date for a Single User

Get-ADUser -identity robert.allen –Properties "DisplayName", "msDS-UserPasswordExpiryTimeComputed" |
Select-Object -Property "Displayname",@{Name="ExpiryDate";Expression={[datetime]::FromFileTime($_."msDS-UserPasswordExpiryTimeComputed")}}

Get Password Expiration Date for Users in an Organizational Unit

Get-ADUser -filter * -SearchBase "OU=Management,OU=ADPRO Users,DC=ad,DC=activedirectorypro,DC=com" –Properties "DisplayName", "msDS-UserPasswordExpiryTimeComputed" | Select-Object -Property "Displayname",@{Name="ExpiryDate";Expression={[datetime]::FromFileTime($_."msDS-UserPasswordExpiryTimeComputed")}}

Get Passwords Expiring in the Next 30 Days

With the AD Pro Toolkit, you can choose a time frame for when passwords will be expiring.

Click the Time button and choose the time frame.

Ищем источник блокировки учетной записи пользователя в active directory

Password Expiration Email Notification

To get an automated email report of password expiration dates use the built in task scheduler.

Click on Scheduler and then click Add to create an automated report.

Ищем источник блокировки учетной записи пользователя в active directory

Using the Net User command to Display Password expiresDate

Open the windows command prompt and type the command below.

Net user USERNAME /domain

In this example, I’ll use the account robert.allen.

In addition to displaying the password expires date it also provides other useful information such as password last set, when the password can be changed if the account is active, and so on.

:/>  Как на время и полностью отключить антивирус Dr. Web на компе с Windows 10

Resolution

Screenshot showing the user account expiry date in PowerShell

To set the expiry date to a specified date:

Screenshot showing setting the user account expiry date in PowerShell

To set the expiry date to never expire:

Screenshot showing setting the user account expiry date to never expires in PowerShell

Popular posts from this blog

LG TV This app will now restart to free up more memory

Image

LG TV Clear All Browsing History Data

Image

LG TV turn off Quick Start in settings

Image

Оставьте комментарий