belowaverage-org / SuperGrate

💾 Get moving with Super Grate; a free & open source Windows Profile Migration & Backup Utility. Super Grate is a GUI (Graphical User Interface) that assists Microsoft's USMT (User State Migration Utility) in performing remote migrations over a network connection.
https://belowaverage.org/software/supergrate
GNU General Public License v3.0
194 stars 23 forks source link

Add Localization (HideBuildInAccounts not working) #67

Closed Manschk3rl closed 1 year ago

Manschk3rl commented 1 year ago

Describe the bug If you have set your operating system to german, the setting "HideBuildInAccounts" does not work. it shows entries like "NT-AUTHORITÄT\SYSTEM" (which is german for "NT-AUTHORITY\SYSTEM")

To Reproduce Steps to reproduce the behavior:

  1. Set your OS language to german.
  2. Start SuperGrate.
  3. Under "Settings" set "HideBuildInAccounts" on "true".
  4. "Source Computer" > local machine
  5. "List Source"
  6. See the error

Expected behavior "NT-xxx" entries should not appear in the list.

Screenshots 1 2

Logs [SUCCESS]<11:49:53> Config loaded! [SUCCESS]<11:49:53> Welcome to Super Grate! v1.3.5.0 [INFO]<11:49:53> Enter some information to get started! [INFO]<11:49:59> Getting list of users on: ZE999-WIN11... [VERBOSE]<11:49:59> Found: ZE999-Win11\test [WARNING]<11:49:59> Could not resolve as an SID via WMI! [VERBOSE]<11:49:59> Found: S-1-5-21-85594344-4232975197-2231365188-1002 [VERBOSE]<11:49:59> Found: ZE999-Win11\Admin [VERBOSE]<11:49:59> Found: NT-AUTORITÄT\Netzwerkdienst [VERBOSE]<11:49:59> Found: NT-AUTORITÄT\Lokaler Dienst [VERBOSE]<11:49:59> Found: NT-AUTORITÄT\SYSTEM [SUCCESS]<11:49:59> Users listed successfully. [INFO]<11:55:00> Writing log to: C:\Users\Admin\Desktop\SuperGrate_30.11.2022_11-54-57.log...

Additional context Im not a programmer but i guess its because the program is searching for "NT AUTHORITY". Found in "SuperGrate/Classes/Misc.cs" line 107 if (bool.TryParse(Config.Settings["HideBuiltInAccounts"], out bool setting) && setting && (**user.Contains("NT AUTHORITY")** || **user.Contains("NT SERVICE")**))

krisdb2009 commented 1 year ago

Thanks for the report, it sounds like I am going to need to localize Super Grate with different languages. That is a big task so might take me a few weeks to build in localization. I will likely need help from you with translating to German as well if you are up for it.

Manschk3rl commented 1 year ago

Hi, i found a better solution. The SID from the NT-Accounts are always S-1-5-18 - 20. I replaced your user.Contains("NT AUTHORITY") || user.Contains("NT SERVICE") with an easy Regex match Regex.IsMatch(SID, @"^S-1-5-[0-9]+$") which searches for the String "S-1-5-" followed by numbers and an end after the numbers. User accounts SID are in a different format. Screenshot 2022-12-01 131343 Super Grate - User Migration   Backup 01 12 2022 13_14_06

krisdb2009 commented 1 year ago

That will work for now, mind sending a pull request?

Manschk3rl commented 1 year ago

Done. But sure im up for the "Add Localization" projekt if you need help with german :)