Error appears when running the: Get-ADPrincipalGroupMembership cmd: "the user has not been authenticated"

Chloe Appleton 20 Reputation points
2023-04-22T12:27:56.4533333+00:00

Hi all, Could anyone please help me with the following script I am trying to run; it has been working fine for me up until now. The only change I think has happened between now and then is upgrading from Windows 10 to Windows 11 within the last week. I am trying to extract a user report to identify which groups they are currently members of within Active Directory. To do this I had initially been doing the following which worked fine for me:-

  1. Open Powershell by running as different user and entering my admin credentials.
  2. Run : Import-Module ActiveDirectory
  3. and finally I would run the following:- Get-ADPrincipalGroupMembership -Identity "UserName"| export-csv -path c:\scripts\usermembershipreport.csv However when I run this now I get the following error:- Get-ADPrincipalGroupMembership : The operation being requested was not performed because the user has not been authenticated At line:1 char:1 Could someone help me around this please? Appreciate any advice. Thanks,
Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
6,966 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,628 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,966 questions
{count} votes

Accepted answer
  1. Rich Matheisen 47,886 Reputation points
    2023-04-22T18:47:21.1633333+00:00

    Does this work if you create a credential for your admin account and use the -Credential parameter on the Get-ADPrincipalGroupMembership cmdlet?

    What about the account delegation setting on your admin account? Is (Get-Aduser <YourAdminAcct> -property accountnotdelegated).accountnotdelegated true or false?

    Over the past several years this problem has been reported and mentioned on quite a few places on various InterNet forums.

    One of the suggested workarounds, if you find the creation of the credential inconvenient, is to just get the users' direct membership from the users' "memberof" property.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.