is there a way to extract ONLY the Date from msDS-UserPasswordExpiryTimeComputed

Please see the following example:

outputs something like this: “7/5/2019 6:23”

what I would like is “7/5/2019”


Any form of help / suggestions are highly appreciated.

Thank you.

If you have a DateTime object you can use all its methods and properties. You can show them like this:

Get-Date | Get-Member

There you can see something like “ToShortDateString”. Adapted to your code snippet this would lead to something like this: