RestrictedUser Posted August 22, 2019 Posted August 22, 2019 Hi AutoIt scriptwriters! In some of windows operating systems, i saw that "Administrator" and "Guest" username in different languages are "Administradore" and "Gast" and etc. How to make a simple script to find Administrator and Guest username in different language in these systems?
AdamUL Posted August 23, 2019 Posted August 23, 2019 Have a look at the Local Account UDF and the _AccountEnum function. Adam
Subz Posted August 23, 2019 Posted August 23, 2019 Another way: #include <Security.au3> Global $g_aComputerSID = _Security__LookupAccountName(@ComputerName) If @error Then Exit ConsoleWrite(_GetAccountName($g_aComputerSID[0] & "-500") & @CRLF) ;~ Administator Account SID ConsoleWrite(_GetAccountName($g_aComputerSID[0] & "-501") & @CRLF) ;~ Guest Account SID Func _GetAccountName($_sAccountSID) Local $aAccountSID = _Security__LookupAccountSid($_sAccountSID, @ComputerName) Local $sAccoutName = @error = 0 And IsArray($aAccountSID) ? $aAccountSID[0] : "" Return $sAccoutName EndFunc Colduction and RestrictedUser 2
RestrictedUser Posted August 23, 2019 Author Posted August 23, 2019 14 hours ago, AdamUL said: _AccountEnum function. I want to automatically detect name of Administrator and Guest accounts in another system that have non-english language _AccountEnum can't help me in this issue
BrewManNH Posted August 23, 2019 Posted August 23, 2019 Don't bother with the Guest account name, 99% of the time that account is disabled and useless for any purposes. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator
RestrictedUser Posted August 23, 2019 Author Posted August 23, 2019 19 hours ago, Subz said: Another way: #include <Security.au3> Global $g_aComputerSID = _Security__LookupAccountName(@ComputerName) If @error Then Exit ConsoleWrite(_GetAccountName($g_aComputerSID[0] & "-500") & @CRLF) ;~ Administator Account SID ConsoleWrite(_GetAccountName($g_aComputerSID[0] & "-501") & @CRLF) ;~ Guest Account SID Func _GetAccountName($_sAccountSID) Local $aAccountSID = _Security__LookupAccountSid($_sAccountSID, @ComputerName) Local $sAccoutName = @error = 0 And IsArray($aAccountSID) ? $aAccountSID[0] : "" Return $sAccoutName EndFunc Thanks @Subz, your code worked properly for me!
RestrictedUser Posted August 23, 2019 Author Posted August 23, 2019 @Subz, I have similar question: How can i find and detect "Administrators" and "Remote Desktop Users" name in Local Groups? because I saw another languages that they were; Administrators =====> Administradores (Germany) Remote Desktop Users ======> Usuarios de escritorio remoto (Spannish)
RestrictedUser Posted August 23, 2019 Author Posted August 23, 2019 6 hours ago, BrewManNH said: 99% of the time that account is disabled and useless for any purposes. No, It's useful for me when i want to grant a person with limited access, such as my brother! :X
Nine Posted August 23, 2019 Posted August 23, 2019 11 minutes ago, Colduction said: when i want to grant a person with limited access, such as my brother “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
BrewManNH Posted August 23, 2019 Posted August 23, 2019 23 minutes ago, Colduction said: No, It's useful for me when i want to grant a person with limited access, such as my brother! :X Then just create an account. If it's REALLY for someone such as your brother then you know what the Guest account is called. I'm stating to smell fish here. Earthshine and FrancescoDiMuro 2 If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator
Developers Jos Posted August 24, 2019 Developers Posted August 24, 2019 @Colduction, Please give me a proper answer this time as you ignored me conveniently last time: What are you really trying to do as this can't have anything to do with your brother and limiting access. Do not ignore me this time as the will have repercussions. Jos @ everybody else: Stay out until this thread is cleared again! FrancescoDiMuro 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Developers Jos Posted August 25, 2019 Developers Posted August 25, 2019 @Colduction, As you elected not to answer yet, your posting capability is revoked until you change your mind and give me that answer. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Recommended Posts