- 论坛徽章:
- 6
|
- 试试VB咯=> http://www.computerperformance.co.uk/index.htm
- sample:
- ' -----------------------------------------------'
- Option Explicit
- Dim objOU, objUser, objRootDSE
- Dim strContainer, strLastUser, strDNSDomain
- ' Bind to Active Directory Domain
- Set objRootDSE = GetObject("LDAP://RootDSE")
- strDNSDomain = objRootDSE.Get("DefaultNamingContext")
- ' -----------------------------------------------'
- ' Important change OU= to reflect your domain
- ' -----------------------------------------------'
- strContainer = "OU=Accounts, "
- strContainer = strContainer & strDNSDomain
- set objOU =GetObject("LDAP://" & strContainer )
- For each objUser in objOU
- If objUser.class="user" then
- ' The heart of this script - Enable users
- objUser.Put "passwordNeverExpires", False
- objUser.SetInfo
- End if
- next
- ' End of Free Sample UserAccountControl VBScript
复制代码 |
|