PowerUpSQL icon indicating copy to clipboard operation
PowerUpSQL copied to clipboard

Connecting from non-domain joined machine

Open 0xJs opened this issue 3 years ago • 3 comments

Im trying to connect from a non-domain joined machine with the following command: Get-SQLInstanceDomain -DomainController dc1.domain.local -Username domain\username -Password password123

It does not show that there are any SQL servers, which there are.

VERBOSE: Grabbing SPNs from the domain for SQL Servers (MSSQL*)...
VERBOSE: 0 SPNs found.
VERBOSE: Parsing SQL Server instances from SPNs...
VERBOSE: 0 instances were found.

Also tried from running with runas the user but no luck.

0xJs avatar Dec 17 '21 14:12 0xJs

At the moment you still have to do a runas /netonly /user domain\user powershell.exe prior to running that command. It’s a known issue. Sorry for the hassle on that one.

nullbind avatar Dec 18 '21 00:12 nullbind

Sorry for response. But I did use runas /netonly /user domain\user powershell.exe

Tried it again:

runas /netonly /user:domain\user powershell.exe

#in new powershell window
PS C:\Windows\system32> Get-SQLInstanceDomain -DomainController dc.domain.local -Verbose
VERBOSE: Grabbing SPNs from the domain for SQL Servers (MSSQL*)...
VERBOSE: 0 SPNs found.
VERBOSE: Parsing SQL Server instances from SPNs...
VERBOSE: 0 instances were found.

Adding -Username domain\user or just user and -password doesn't work with it either.

0xJs avatar Dec 23 '21 14:12 0xJs

Running a powerview command in the same sessions (from the runas) with just the -Server parameter works.

0xJs avatar Dec 23 '21 14:12 0xJs