Skip to content

Commit

Permalink
Check if ResolveAccountName returns a value
Browse files Browse the repository at this point in the history
  • Loading branch information
nurfed1 committed Dec 23, 2023
1 parent da6b83c commit 920514f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/CommonLib/Processors/GPOLocalGroupProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,11 @@ internal IEnumerable<GroupAction> ProcessGPOXmlFile(string basePath, string gpoD
var domain = s[0];

var res = _utils.ResolveAccountName(name, domain);
if (res == null)
{
_log.LogWarning("Failed to resolve member {memberName}", memberName);
continue;
}
ga.Target = GroupActionTarget.LocalGroup;
ga.TargetSid = res.ObjectIdentifier;
ga.TargetType = res.ObjectType;
Expand All @@ -540,6 +545,11 @@ internal IEnumerable<GroupAction> ProcessGPOXmlFile(string basePath, string gpoD
else
{
var res = _utils.ResolveAccountName(memberName, gpoDomain);
if (res == null)
{
_log.LogWarning("Failed to resolve member {memberName}", memberName);
continue;
}
ga.Target = GroupActionTarget.LocalGroup;
ga.TargetSid = res.ObjectIdentifier;
ga.TargetType = res.ObjectType;
Expand Down

0 comments on commit 920514f

Please sign in to comment.