I've noticed that when I use Powershell to get the group membership of an Active Directory domain security group, the Powershell cmdlet Get-ADGroupMember $Group
fails with the error message:
PS C:\> get-adgroupmember MyGroup
get-adgroupmember : An operations error occurred
At line:1 char:1
+ get-adgroupmember MyGroup
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (MyGroup:ADGroup) [Get-ADGroupMember], ADException
+ FullyQualifiedErrorId : ActiveDirectoryServer:8224,Microsoft.ActiveDirectory.Management.Commands.GetADGroupMember
I have tried specifying the -server $DC
parameter so that the cmdlet targets a specific DC, and then I check the Security logs on that DC as I reproduce the error and no relevant security failure audits are generated. I turned up all the Diagnostics registry entries in the services\NTDS\Diagnostics
key and that doesn't produce anything interesting in the Directory Services logs either.
If I remove the group members that reside in the other domain from MyGroup, the cmdlet works no problem.
Interestingly, I notice that if I run the command locally on the DC itself, it works. But when I run the command remotely from a member server, using the same user account, (who is a Domain Admin,) it fails.
Any idea what's wrong?
Active Directory Powershell cmdlets such as
Get-ADGroupMember
use Active Directory Web Services (ADWS).A statement such as
is often a red flag that the underlying problem is Kerberos Delegation.
Many services take advantage of Kerberos delegation, and ADWS is no exception.
So let's look at my Kerberos ticket-granting-ticket (TGT):
Turn your attention toward the Ticket Flags field. Something is missing. This ticket is not forwardable.
Why would a ticket not be forwardable?
I uncheck that checkbox, flush my Kerberos tickets with
klist purge
, get a new tgt by performing any sort of network activity that requires getting a new tgt if I don't already have one, (gpupdate
is a good example,) inspect the TGT again, and I notice that it now includes the forwardable flag.Now the Powershell cmdlet works as expected from a member server.
When the group contains security principals (users or groups) from another domain, a referral is returned that must be chased. In order to chase that referral, ADWS must impersonate the user who made the original call. If Kerberos delegation is disabled on that user account, impersonation/delegation cannot happen.
This behavior has changed with recent Windows Server security updates.
The secure default is now to disable TGT Delegation across forest trusts. Because of this Get-ADGroupMember will fail on groups with cross-forest Foreign Security Principals until Microsoft decides to fix the issue. Until then, one workaround is to use:
Get-ADGroup -Properties member