#include <Array.au3>
#include <LocalSecurityAuthority.au3>
; 枚举本地用户组。
$aGroups = _LsaEnumerateLocalGroups()
_ArrayDisplay($aGroups)
; 枚举本地所有用户
; $aUsers = _LsaEnumerateLocalUsers()
_ArrayDisplay($aUsers)
; 列举administrators组中的用户
$aMember = _LsaLocalGroupGetMembers("Administrators")
_ArrayDisplay($aMember)
; 从管理员组中删除test用户(test依然存在)
$iResult = _LsaLocalGroupDelMembers("Administrators", "test")
If $iResult Then Msgbox(0, "Ok", "Done")
; 彻底删除test用户
$iResult = _LsaDelLocalUser("test")
If $iResult Then Msgbox(0, "Ok", "Done")
; 删除administrators用户组,慎用。
$iResult = _LsaDelLocalGroup("Administrators")
If $iResult Then Msgbox(0, "Ok", "Done")
LocalSecurityAuthority.au3 http://www.autoitx.com/forum.php ... page%3D1&page=1 |