make BUILTIN go away

This commit is contained in:
2025-11-10 16:12:34 -08:00
parent 84ca0907ef
commit 4386165c39
2 changed files with 8 additions and 3 deletions
+6 -1
View File
@@ -24,10 +24,15 @@ def get_groups():
for detail in details:
# Check if 'ad_group' exists and is not None before accessing it
ad_group = detail.get('ad_group')
# this allows for partial search
if isinstance(ad_group, str) and re.search(re.escape(group_name.lower()), ad_group.lower()):
# i don't like BUILTIN\ so I'm getting rid of it
local_group = detail.get('local_group')
if isinstance(local_group, str) and local_group.startswith("BUILTIN\\"):
local_group = local_group.split("\\", 1)[1]
gpos.append({
"gpo": gpo,
"local_group": detail['local_group'],
"local_group": local_group,
"ad_group": detail['ad_group']
})
return jsonify(gpos)