Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

Powershell script- password information

$
0
0

Forgive me I am still new to scripting.

I made the script below to verify password information. However, I want multiple people here to user it. So I would like to make the "username" field a fill in the blank spot. That means that we are prompted to put in a username when running the script. How can I changed my script to do this?

------------------------------------------------------------------------------------------------------------------------

Import-Module ActiveDirectory

get-aduser -identity username -properties passwordlastset,passwordexpired,lockedout,"msDS-UserPasswordExpiryTimeComputed" |

Select-Object -Property "SamAccountName",passwordexpired,lockedout,passwordlastset, @{Name="Password Expiry Date"; Expression={[datetime]::FromFileTime($_."msDS-UserPasswordExpiryTimeComputed")}} |

Format-Table


Viewing all articles
Browse latest Browse all 15370

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>