Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if ResolveAccountName returns a value #90

Merged
merged 1 commit into from
Jan 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading