title: "Access is denied." Error when Updating Active Directory Group
body: <p><a href="https://i.stack.imgur.com/xPlXV.png" rel="nofollow noreferrer">Code Snippet</a></p>
  <p>I am using ASP.NET Core 3.1 to attempt to edit members of a group in Active Directory. I am using IIS with Pass Through Windows Authentication. This works fine when running using IISExpress in Visual Studio but when I push it to IIS calling the group.save(); function I get the error: Exception:
  System.UnauthorizedAccessException: Access is denied.</p>
  <p>at System.DirectoryServices.Interop.UnsafeNativeMethods.IAds.SetInfo()
  at System.DirectoryServices.DirectoryEntry.CommitChanges()
  at System.DirectoryServices.AccountManagement.ADStoreCtx.UpdateGroupMembership(Principal group, DirectoryEntry de, NetCred credentials, AuthenticationTypes authTypes)
  at System.DirectoryServices.AccountManagement.SDSUtils.ApplyChangesToDirectory(Principal p, StoreCtx storeCtx, GroupMembershipUpdater updateGroupMembership, NetCred credentials, AuthenticationTypes authTypes)
  at System.DirectoryServices.AccountManagement.ADStoreCtx.Update(Principal p)
  at System.DirectoryServices.AccountManagement.Principal.Save()</p>