Issues with credentials stored with Export-CliXml

Bojan Zivkovic 606 Reputation points
2025-03-03T13:59:25.9066667+00:00

Hi, I am having issues with credentials stored with Export-CliXml:

$credxmlpath = "C:\Temp\mycredential.xml"

$cred = Import-Clixml -Path $credxmlpath

Enter-PSSession -ComputerName ServerName -Credential $cred

Enter-PSSession: Cannot process argument transformation on parameter 'Credential'. userName

What can be wrong here? I am not a local admin on my laptop just to note here if important.

Windows for business | Windows Server | User experience | PowerShell
{count} votes

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.