Hello. Invalid connection object name.
WID sql RDCB list of connected
Hello. Tell me how to implement the idea.
I want to get a list of connected employees with remote IP addresses from the WID RDCB database.
Invoke-Sqlcmd -ServerInstance np:\\.\pipe\MICROSOFT##WID\tsql\query -Database RDCms -Encrypt Optional "SELECT username from dbo.rdcms"
Windows для бизнеса | Windows Server | Взаимодействие с пользователем | Другое
Ответы: 2
Сортировать по: Наиболее полезные
-
-
Jacen Wang 1,000 Баллы репутации Внешний персонал Microsoft
2024-07-07T00:38:44.4766667+00:00 Hello,
You can try the steps below to execute the query:
- Launch SQL Server Management Studio and connect to WID. In SSMS, choose
Database Engineas the server type. For server name, enter\\.\pipe\MICROSOFT##WID\tsql\query. ChooseWindows Authentication. - Open a new query window. Fall in the actual database name and execute the query.
Here’s an example query. Note that the exact table and column names can vary based on your specific configuration:
USE RDCbDB; -- Replace with your actual RDCB database name GO SELECT Sessions.SessionID, Sessions.UserName, Connections.RemoteIPAddress, Sessions.SessionState FROM Sessions JOIN Connections ON Sessions.ConnectionID = Connections.ConnectionID WHERE Sessions.SessionState = 'Active'; -- filter by active sessions, if neededNote: You need to require modification based on the actual schema of your RDCB database. Always ensure you have proper backups and access rights before making changes or running queries against critical databases. ———————————————————————————————————
If the Answer is helpful, please click "Accept Answer" and upvote it.
- Launch SQL Server Management Studio and connect to WID. In SSMS, choose