Quantcast
Channel: PowerShell.org » All Posts
Viewing all articles
Browse latest Browse all 13067

Set Get-ADUser PasswordLastSet property

$
0
0

Hello all,

I’m trying to create a script that will force specific domain users to have to reset their password earlier than the domain password policy. Unfortunately, due to our environment our Domain functional level is only 2003 so we’re unable to use Fine Grain Password policy. The main issue I’m running into is that in an effort to be more polite to the end user rather than just forcing them on a certain day to have to reset their passwords, to change the date on their Password Last Set value so they can have the windows notification pop up for them when they log in as well as an email as a reminder.

My problem is that I can’t seem to modify the date in the property. It looks to be a system.datetime object and when I try what I assume would work…


Set-ADUser dduck -Replace @{PWDLastSet="((Get-Date).AddDays(-85))"}

I get an error message : The parameter is incorrect,Microsoft.ActiveDirectory.Management.Commands.SetADUser. Due to that error message I guess that it’s not an problem with the date format, but that I’m not using the correct method.

Any help would be greatly appreciated.


Viewing all articles
Browse latest Browse all 13067

Trending Articles