Unlocking Locked Out accounts using PowerShell (not with Quest AD cmdlets)

让人想犯罪 __ 提交于 2019-12-12 10:55:43

问题


I'm writing a GUI tool using PowerShell that is able to do most AD related tasks with just a user name and button click. I've done all the usual ones (Create / Remove Users, Create / Remove Security & Distribution Groups, Resetting Passwords, etc) but can't find away of unlocking a "Locked Out" account.

I'm trying to do this without using Quest AD cmdlets as I want a more stand alone solution. So I'm wondering whether is possible with plain PowerShell (1.0 or 2.0) in a Windows 2003 Domain.

Many thanks.


回答1:


Set the lockoutTime property of the DirectoryEntry to 0.

Sample:

$x = [ADSI]'LDAP://SomeDN'
$x.lockoutTime = 0
$x.CommitChanges()
$x.Close()



回答2:


Been out of the AD world for a few years. I haven't worked with PowerShell at all but does the link below offer what you're looking for?

http://dmitrysotnikov.wordpress.com/2007/08/14/enable-disable-unlock-user-accounts/



来源:https://stackoverflow.com/questions/2585205/unlocking-locked-out-accounts-using-powershell-not-with-quest-ad-cmdlets

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!