oviradoi Posted July 17, 2008 Share Posted July 17, 2008 Hello. Does anyone know how to get a list of users in Windows XP / Vista using AutoIT? I need a list of the user accounts created in Windows. Link to comment Share on other sites More sharing options...
smashly Posted July 17, 2008 Share Posted July 17, 2008 (edited) Hi, not sure if it works in vista, but it works ok in xp.#include <array.au3> ; Not needed by _ListUsers() $LU = _ListUsers() If Not @error Then _ArrayDisplay($LU, "List Users") Func _ListUsers() Local $colUsers, $sTmp, $Array[1] = ["user"] $colUsers = ObjGet("WinNT://" & @ComputerName) If Not IsObj($colUsers) Then Return SetError(1, 0, 0) $colUsers.Filter = $Array For $objUser In $colUsers $sTmp &= $objUser.Name & "|" Next Return SetError(0, 0, StringSplit(StringTrimRight($sTmp, 1), "|")) EndFunc Cheers Edit: corrected function name. Edited July 17, 2008 by smashly Link to comment Share on other sites More sharing options...
oviradoi Posted July 17, 2008 Author Share Posted July 17, 2008 Thanks! You guys are great! muttley Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now