PowerShell 7.3 - implementing Remoting and Credential Delegation for Invoke-Command
I'm working on a project and hit a roadblock. I'm stuck trying to I'm currently working with an scenario with PowerShell remoting while trying to use `Invoke-Command` with credential delegation in PowerShell 7.3. I've set up a script to run commands on remote servers, but I'm seeing an behavior that says `The user name or password is incorrect` even though the credentials are correct. Here’s the code I’m using to establish the session: ```powershell $credential = Get-Credential $session = New-PSSession -ComputerName 'RemoteServer01' -Credential $credential -Authentication Negotiate Invoke-Command -Session $session -ScriptBlock { Get-Process } | Out-File -FilePath 'C:\Logs\processes.txt' ``` I've ensured that the remote server allows WinRM connections, and I can successfully connect to it directly via PowerShell. I also tried using `-Authentication CredSSP` but received an behavior stating `The server want to accept the credentials that you provided`. Both the local and remote machines are part of the same domain. I’ve tried checking for Group Policy settings that might restrict delegation but haven’t found anything obvious. Additionally, I have verified that the service on the remote server is running with the correct permissions, and I’ve tested the connection without credentials using `Enter-PSSession`, which works fine. Any insights into what might be causing this credential scenario or how to troubleshoot it further would be greatly appreciated! For reference, this is a production CLI tool. Any suggestions would be helpful. I recently upgraded to Powershell 3.9. I'm open to any suggestions.