Help us understand the problem. What is going on with this article?

PowershellでActiveDirectoryユーザーのpwdLastSetを人間の読める値へ変更する

変更前

132128346183950472だといつか分からない

PS C:\Users\administrator.CHASE> Get-ADUser -Identity test10 -Property * | Select-Object -Property SamAccountName, pwdLastSet

SamAccountName         pwdLastSet
--------------         ----------
test10         132128346183950472

変更後

datetime型へ変更している
詳しくはよくわかないです・・

PS C:\Users\administrator.CHASE> Get-ADUser -Identity test10 -Property * | Select-Object -Property SamAccountName, @{Name="pwdLastSet";Expression={[datetime]::FromFileTime($_."pwdLastSet")}}

SamAccountName pwdLastSet
-------------- ----------
test10         2019/09/13 16:50:18


PS C:\Users\administrator.CHASE>

ちなみに

Get-ADUserコマンドレットにはPasswordLastSetというプロパティがあるので、これを使えばOK。直近のパスワード変更日時のことですね。

PS C:\Users\administrator.CHASE> Get-ADUser -Identity test10 -Property * | Select-Object -Property SamAccountName, @{Nam
e="pwdLastSet";Expression={[datetime]::FromFileTime($_."pwdLastSet")}},PasswordLastSet

SamAccountName pwdLastSet          PasswordLastSet
-------------- ----------          ---------------
test10         2019/09/13 16:50:18 2019/09/13 16:50:18
Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away