[Resolved] New-PSSession error: The method or operation is not implemented

Hi guys, this is a weird one, can someone please help?

I am trying to create Exchange 2016 PowerShell session, it works outside of PSUD, but when I run it within UD page, I get below error:

New-PSSession : Cannot process argument transformation on parameter 'Credential'. The method or operation is not implemented.
At line:8 char:161
+ ... .local/PowerShell/" -Authentication Kerberos -Credential $psexchROsvc
+                                                              ~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [New-PSSession], ParameterBindingArgumentTransformationException
    + FullyQualifiedErrorId : ParameterArgumentTransformationError,Microsoft.PowerShell.Commands.NewPSSessionCommand

The command I am running is straight forward and should work to be fair, but it craps out and I am out of ideas:
New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri "http://exchange.domain.local/PowerShell/" -Authentication Kerberos -Credential $psexchROsvc

I wonder if this has to do with the PSUD PowerShell host. I’ll add it to my todo list to check this out. I take it $psexchROsvc is an PSCredential object?

Hi @adam
Yup, just normal creds, works fine outside of PSUD

Ok. Logged an issue on our backlog and will take a look.

1 Like

Thanks, @adam
Not sure if helps, but I have commented out below part and getting different error. Ofc, I’m just messing around here as I need those params :slight_smile:

# -Authentication Kerberos #-Credential $psexchROsvc

Error:
Self referencing loop detected for property 'module' with type 'System.Management.Automation.PSModuleInfo'. Path '[1].exportedFunctions.add-DistributionGroupMember'.

Sounds like a PSModuleInfo object is being dropped output and UD is trying to serialize it as JSON and it’s throwing this error.

Probably related to: New-PSUEndpoint - Self referencing loop detected

Hi @adam

Just want to throw in that I get same exact error with other cmdlets that use -Credential params, too:

Get-ADUser "RAYMIX" -Credential $psadROsvc

Hopefully that helps you with the pattern of the issue

Offtopic:
I’m gonna have to postpone my UD project until these gets resolved because every page will fundamentally depend on it, lol (least-privilege models, JEA and all that fun stuff).
I also noticed the new features in 1.4, damn dudes, well done! I was shaking in excitement reading patch notes :smiley: Can’t wait!

Cheers

Good to know. Might be a more pressing issue than I thought. We’re trying to button down 1.4 so I’ll see if I can get this fix in there too.

Glad you’re excited. It’s gonna be a good one!

Is it possible that that credential variable is null? The reason it’s throwing the not implemented exception is because the UDHost is attempting to prompt for a credential but that isn’t implemented in UD.

I ask because when I try this, this is the result.

$Pages = @()

$Pages += New-UDPage -Name "Admin"  -Content {
    $UserName = "Foo"
    $pass = ConvertTo-SecureString "bar" -AsPlainText -Force
    $cred =  New-Object -TypeName PSCredential -ArgumentList $UserName, $pass
    $Obj = New-PSSession -ComputerName localhost -Credential $Cred 
}

New-UDDashboard -Title 'Testing' -Pages $Pages

Then in the log

[09-25-20 10:55:17 AM] PS: [localhost] Connecting to remote server localhost failed with the following error message : Access is denied. For more information, see the about_Remote_Troubleshooting Help topic. 
1 Like

@adam well that’s super embarrassing, lol. You’re absolutely right the credentials were null within UD.
I completely forgot that Cache is a custom made scope and won’t work like below :man_facepalming:

Set-Variable -Name "$($target.Replace('-',''))" -Value (Get-StoredCredential -Target "PSU:$target" -Type Generic) -Scope Cache

Think I’m just gonna save creds in a hashtable for now and retrieve them that way

Sorry for wasting your time, dude and thank you for taking time to look at it.

1 Like

It’s all good. Glad it’s working!