Jump to content

Recommended Posts

Posted

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?

Posted

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

 

Posted
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

Posted

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 Gude
How 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

Posted
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!

Posted

@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)
Posted
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

Posted
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.

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 Gude
How 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
Posted

@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!

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.
  :)

  • Jos locked this topic
Guest
This topic is now closed to further replies.
×
×
  • Create New...