Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get-DbaHideInstance does not work on a system with named instance #9350

Open
michele-tahay-kohera opened this issue May 14, 2024 · 2 comments
Labels
bugs life triage required New issue that has not been reviewed by maintainers

Comments

@michele-tahay-kohera
Copy link

Verified issue does not already exist?

I have searched and found no existing issue

What error did you receive?

When running this command, you don't get results but also not any error as well

Get-DbaHideInstance -SqlInstance localhost\namedInstance1

You do get an error when you call it with the -EnableException parameter:
image

The registry item is there all right, and my powershell session is running in admin mode
image

It is possible that it is a permission issue, but then it should clearly state so in a warning/error message.

Steps to Reproduce

# provide your command(s) executed pertaining to dbatools
# please include variable values (redacted or fake if needed) for reference

Get-DbaHideInstance -SqlInstance localhost\namedInstance1

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

2.1.14

Other details or mentions

I'm trying to test out dbachecks on my local machine with 2 (almost empty) named instances.
This dbatools command is used in the check "HideInstance", and when it is included it doesn't fail but makes another test fail ("LoginPasswordExpiration") with a message "We Could not Connecto to $Instance"

What PowerShell host was used when producing this error

VS Code (integrated terminal)

PowerShell Host Version

Name Value


PSVersion 5.1.22621.2506
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.22621.2506
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 2019 (RTM-GDR) (KB5035434) - 15.0.2110.4 (X64) Mar 12 2024 18:25:56 Copyright (C) 2019 Microsoft Corporation Developer Edition (64-bit) on Windows 10 Pro 10.0 (Build 22631: ) (Hypervisor)

.NET Framework Version

.NET Framework 4.8.9181.0

@michele-tahay-kohera michele-tahay-kohera added bugs life triage required New issue that has not been reviewed by maintainers labels May 14, 2024
@michele-tahay-kohera
Copy link
Author

Oh, in case you should wonder, it is the same thing with the other installed instance (sql 2022)

@andreasjordan
Copy link
Contributor

As it is a local instance - do you run the command from an elevated PowerShell session? This should be needed to get to the registry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugs life triage required New issue that has not been reviewed by maintainers
Projects
None yet
Development

No branches or pull requests

2 participants