dataplat / dbatools

🚀 SQL Server automation and instance migrations have never been safer, faster or freer
https://dbatools.io
MIT License
2.39k stars 787 forks source link

Test-DbaSpn returns nothing when one of multiple instances does not have tcp/ip enabled on Windows Server 2022 #9315

Open jthurl opened 3 months ago

jthurl commented 3 months ago

Verified issue does not already exist?

I have searched and found no existing issue

What error did you receive?

No output from test-dbaspn.

Steps to Reproduce

test-dbaspn -ComputerName $env:COMPUTERNAME

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

I believe so, I have installed the latest today which shows as 2.1.12 and 2024.3.9

Other details or mentions

I am running the test-dbaspn command as a local and domain (AWS delegated administrator) administrator in an administrator powershell. UAC is disabled. There are two sql instances installed here which are both running under a domain service account. One has tcp/ip enabled and one does not. If I enable tcp/ip on the other instance then test-dbaspn returns as expected for both instances.

This issue came out of us first seeing an error from test-dbaspn in the same circumstances on version 2.0.4.

What PowerShell host was used when producing this error

Windows PowerShell (powershell.exe)

PowerShell Host Version

Name Value


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

SQL Server Edition and Build number

Instance without tcp/ip enabled: Microsoft SQL Server 2016 (SP1) (KB3182545) - 13.0.4001.0 (X64) Oct 28 2016 18:17:30 Copyright (c) Microsoft Corporation Developer Edition (64-bit) on Windows Server 2022 Datacenter 6.3 (Build 20348: ) (Hypervisor)

Instance with tcp/ip enabled: Microsoft SQL Server 2022 (RTM) - 16.0.1000.6 (X64) Oct 8 2022 05:58:25 Copyright (C) 2022 Microsoft Corporation Developer Edition (64-bit) on Windows Server 2022 Datacenter 10.0 (Build 20348: ) (Hypervisor)

.NET Framework Version

Neither of these commands worked but I know it 4.8.