March 29, 2010 at 3:35 am
Hello All,
Can any one please help me find a way to get the list of remote desktop connections to a server through TSQL scripts/system tables.
E.g: the sql server name is "SQLServerXYZ"
Now i want to find the list of all the people who has an active Remote desktop connection to server "SQLServerXYZ". SQL Server 2000 enterprise edition is installed on the server.
Note: I want the remote desktop connections not the remote login connections.
Thanks
Naresh
March 29, 2010 at 5:27 am
Hi,
Use xp_cmdshell to run qwinsta. you will have to format the results.
More details here:
HTH,
Meir
March 29, 2010 at 5:39 am
Not using SQL directly:
The WMI ODBC Adapter is not available in Windows Server 2003. When you upgrade to Windows Server 2003 from Windows 2000 Server, the WMI ODBC Adapter is not removed if already present on a computer. The ODBC Adapter may be unsupported in subsequent versions of Windows.
http://msdn.microsoft.com/en-us/library/aa392726(VS.85).aspx#odbc%5Fadapter
Recommend that you write a VBScript that queries the WMI Win32_LogonSession Class http://msdn.microsoft.com/en-us/library/aa394189(VS.85).aspx. The VBScript could include logic to insert into a SQL Server table.
SQL = Scarcely Qualifies as a Language
March 30, 2010 at 12:20 am
Thanks for the help guys. I'll update this thread with my findings based the the links provided by you.
March 30, 2010 at 10:13 am
Hi
you may also want to post this in the appropriate forum in future
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs" 😉
March 30, 2010 at 1:33 pm
You could also use dos query user query user via xp_cmdshell and punt the output into a table and then parse this out to find rdp sessions.
Andrew
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply