dbatools icon indicating copy to clipboard operation
dbatools copied to clipboard

Update-DbaInstance issue with CredSSP authentication - wrong credentials

Open mikedavem opened this issue 2 years ago • 5 comments

Verified issue does not already exist?

I have searched and found no existing issue

What error did you receive?

WARNING: [08:47:32][Update-DbaInstance] Error while looking for SQL Server installations on xxxxx | Connecting to remote server xxxxx failed with the following error mess age : The user name or password is incorrect. For more information, see the about_Remote_Troubleshooting Help topic.

Steps to Reproduce

 Update-DbaInstance `
     -ComputerName '<computername>'`
     -Download `
     -Version '2022RTMCU9' `
     -Confirm:$false `
     -Restart -Credential $cred -Authentication Credssp -Path '<path>' 

Please confirm that you are running the most recent version of dbatools

Major Minor Build Revision


2 1 4 -1

Other details or mentions

I try to use Update-DbaInstance against SQL instances in workgroup.

CredSSP is already configured and work well. For instance, when I use the following command:

 $p = New-PSSession -ComputerName <servername> -Credential $cred -Authentication Credssp
Invoke-Command -Session $p -ScriptBlock { 
    Get-ComputerInfo | Select-Object PSComputerName
}
Disconnect-PSSession -Session $p 

I disabled the automatic configuration of CredSSP by dbatools ...

Set-DbatoolsConfig -Name commands.initialize-credssp.bypass -Value $true 

... But the same credentials that work with the above command seems to not work with Update-DbaInstance command

I tried with both PowerShell ISE and PowerShell.

I'm not sure this is a bug at this stage, maybe something I missed from my side.

What PowerShell host was used when producing this error

Windows PowerShell (powershell.exe)

PowerShell Host Version

Name Value


PSVersion 5.1.14393.6343
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14393.6343
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

SQL Server Edition and Build number

Microsoft SQL Server 2022 (RTM-CU8-GDR) (KB5029503) - 16.0.4080.1 (X64) Sep 1 2023 09:38:16 Copyright (C) 2022 Microsoft Corporation Developer Edition (64-bit) on Windows Server 2022 Datacenter 10.0 <X64> (Build 20348: ) (Hypervisor)

.NET Framework Version

.NET Framework 4.8.4645.0

mikedavem avatar Oct 24 '23 07:10 mikedavem

I can not reproduce the issue.

Can you run the command with -Verbose and provide the output?

Maybe @FriedrichWeinmann has an idea where to look next?

andreasjordan avatar Oct 29 '23 17:10 andreasjordan

Hi @andreasjordan

Verbose mode:

VERBOSE: [17:53:44][Resolve-DbaNetworkName] Resolving xxxx using .NET.Dns GetHostEntry
VERBOSE: [17:53:44][Resolve-DbaNetworkName] Resolving xx.xxx.xxx.xxx using .NET.Dns GetHostByAddress
VERBOSE: [17:53:44][Get-DbaCmObject] Configuration loaded | Cache disabled: False
VERBOSE: [17:53:44][Get-DbaCmObject] [xxxx Retrieving Management Information
VERBOSE: [17:53:44][Resolve-DbaNetworkName] Unable to get domain name from xxxx
VERBOSE: [17:53:44][Resolve-DbaNetworkName] Resolving xxxx using .NET.Dns GetHostEntry
WARNING: [17:53:45][Update-DbaInstance] Error while looking for SQL Server installations on xxxx | Connecting to remote server xxxx failed with the following error message : The user name or password is incorrect. For more information, see the about_Remote_Troubleshooting Help topic. 

Debug

DEBUG: 87465 | [17:52:16][Update-DbaInstance] Parsed Version as Major 2022 SP  CU 9
DEBUG: 87517 | [17:52:16][Update-DbaInstance] Added installation action {"CumulativeUpdate":"9","MajorVersion":"2022"}
DEBUG: 70573 | [17:52:16][Resolve-DbaNetworkName] Resolving xxxxx using .NET.Dns GetHostEntry
DEBUG: 70583 | [17:52:16][Resolve-DbaNetworkName] Resolving 10.233.140.186 using .NET.Dns GetHostByAddress
DEBUG: 70653 | [17:52:16][Resolve-DbaNetworkName] Getting domain name from the remote host xxxxx
DEBUG: 22495 | [17:52:16][Get-DbaCmObject] Configuration loaded | Cache disabled: False
DEBUG: 22508 | [17:52:16][Get-DbaCmObject] [xxxxx] Retrieving Management Information
DEBUG: 22548 | [17:52:16][Get-DbaCmObject] [xxxxx] Accessing computer using Cim over WinRM
DEBUG: 22559 | [17:52:17][Get-DbaCmObject] [xxxxx] Accessing computer using Cim over WinRM - Failed
DEBUG: [17:52:18][Get-DbaCmObject] [xxxxx] Invalid connection credentials
DEBUG: 70687 | [17:52:20][Resolve-DbaNetworkName] Unable to get domain name from xxxxx
DEBUG: 70692 | [17:52:20][Resolve-DbaNetworkName] Resolving xxxxx using .NET.Dns GetHostEntry
DEBUG: 93286 | [17:52:20][Invoke-Command2] Creating new Default session [dbatools_Default_a37a1421-404a-4df5-a405-5a8ea09d8bac_xxxxxxfor xxxxxx
WARNING: [17:52:21][Update-DbaInstance] Error while looking for SQL Server installations on xxxxx | Connecting to remote server xxxxx failed with the following error message : The user name or password is incorrect. For more information, see the about_Remote_Troubleshooting Help topic.
DEBUG: [17:52:21][Update-DbaInstance] Error while looking for SQL Server installations on xxxxx | Connecting to remote server xxxxx failed with the following error message : The user name or password is incorrect. For more information, see the about_Remote_Troubleshooting Help topic. 

mikedavem avatar Nov 03 '23 17:11 mikedavem

Thanks for the output. But we have to wait for @FriedrichWeinmann to take a look at this.

andreasjordan avatar Nov 05 '23 09:11 andreasjordan