|
|
re:你进不去就给你贴出来Enable U...
你进不去就给你贴出来<br>
Enable Users to Change Their Passwords<br>
<br>
Description<br>
<br>
Disables the User Cannot Change Password option, allowing the user to change their password. <br>
<br>
Supported Platforms<br>
<br>
Windows Server 2003<br>Yes<br><br>
Windows XP<br>Yes<br><br>
Windows 2000<br>Yes<br><br>
Windows NT 4.0<br>Yes<br><br>
Windows 98<br>Yes<br><br>
<br>
Script Code<br>
<br>
Const ADS_ACETYPE_ACCESS_DENIED_OBJECT = &H6<br>
Const CHANGE_PASSWORD_GUID = _<br>"{ab721a53-1e2f-11d0-9819-00aa0040529b}"<br><br>
Set objUser = GetObject _<br>("LDAP://cn=myerken,ou=management,dc=fabrikam,dc=com")<br>
Set objSD = objUser.Get("nTSecurityDescriptor")<br>
Set objDACL = objSD.DiscretionaryAcl<br>
arrTrustees = Array("nt authority\self", "everyone")<br><br>
For Each strTrustee In arrTrustees<br>For Each ace In objDACL<br>If(LCase(ace.Trustee) = strTrustee) Then<br>If((ace.AceType = ADS_ACETYPE_ACCESS_DENIED_OBJECT) And _<br>(LCase(ace.ObjectType) = CHANGE_PASSWORD_GUID)) Then<br>objDACL.RemoveAce ace<br>End If<br>End If<br>Next<br>
Next<br><br>
objUser.Put "nTSecurityDescriptor", objSD<br>
objUser.SetInfo<br>
<br>
For online peer support, join the microsoft.public.windows.server.scripting community on the msnews.microsoft.com news server. To provide feedback or report bugs in sample scripts or the Scripting Guide, please contact Microsoft TechNet.<br>
<br>
Disclaimer<br>
<br>
The sample scripts are not supported under any Microsoft standard support program or service. The sample scripts are provided AS IS without warranty of any kind. Microsoft further disclaims all implied warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample scripts and documentation remains with you. In no event shall Microsoft, its authors, or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample scripts or documentation, even if Microsoft has been advised of the possibility of such damages.<br>
<br>
|
|