Hoping someone maybe able to help with the below error i get when running a powershell script i created. It worked before fine no issues.
"The Operation being Requested was not performed because the user has not been authenticated."
So the account is permissoned fine and i can run various commands fine in PS. The script works fine on another users machine no issues. I can get around the error with -ResourceContextServer parameter but this is not ideal as this is part of a gui which will look at another domain on top of Domain A. So i use that it will not search Domain B when prompted.
Google has given me little insight although i found on thing which i tried and it worked for a period then i get the same again
$PSDefaultParameterValues.Add('Get-ADPrincipalGroupMembership:Server',"$((Get-ADDomain).PDCEmulator)")
The command that is causing the issues is Get-ADPrincipalGroupMembership running in PS on it own i get the same. Running other commands is fine and no issues.
Anyone else seen this and have solution. It is making things hard when i want to update the script and test it.
Thanks