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
-Server
and even when directing to a non-PDCe, regardless of the default for-Server
. With my Dom Adm account, I can reproduce when specified through$PSDefaultParameterValues
and manually specifying-Server
, but not when manually specifying a non-PDCe server. It doesn't seem to happen with other AD cmdlets either. – Vtehsta-ResourceContextServer
for this as it can be used via a button to pull from another domain. only other thing i can think of thats changed was i added some extra logging and error abilities but tests on other machines work. – SoldieryGet-ADPrincipleGroupMembership
, but it'sGet-ADPrincipalGroupMembership
– Delusion'(Get-ADPrincipalGroupMembership -Server $servername)'
instead of'Get-ADPrincipalGroupMembership:Server'
– Delusion