Hello,
To resolve the issue, use ADSI interfaces for adding members to the group. For example, you can use the following code:
$groupPath = "Adaxes://adaxesserver.example.com/CN=My Group,CN=Users,DC=example,DC=com"
$group = $Context.BindToObjectEx($groupPath, $true)
try
{
$group.Add($Context.TargetObject.AdsPath)
}
catch [System.Runtime.InteropServices.COMException]
{
if ($_.Exception.ErrorCode -eq "-2147483638")
{
$groupName = $group.Get("name")
$Context.LogMessage("A request was made to add the user to group $groupName. The request is pending approval.", "Information")
}
else
{
throw $_.Exception
}
}
where $groupPath is the ADS path of the group you want to add a member to.