Quantcast
Channel: Remote Desktop Services (Terminal Services) forum
Viewing all 1106 articles
Browse latest View live

Where is the Remote Desktop Session Host Configuration tool in Server 2012 ?

$
0
0

Where is the Remote Desktop Session Host Configuration tool in Server 2012 ?

This is an MMC snap-in found on earlier servers, even if RDS is not installed.  In Server 2012, even if the Remote Desktop Session Host role is installed, this tool is still not available.

I'm looking for the Server 2012 tool to adjust security settings like TLS authentication, High encryption level, choice of TLS certificate, NLA, etc.

Thanks!


Adding favicon.ico to 2012 RDS Web page

$
0
0
Trying to add a custom favicon.ico to our 2012 RDS Web Access.   I've tried putting it in C:\inetpub\wwwroot and C:\Windows\Web\RDWeb with no sucess.   Any ideas?

Publish .lnk to mapped drive

$
0
0

I have an RDS farm, 2 sessions hosts and connection broker, etc. I publish apps from the connection broker but have one I am having issues with.

The program is actually fired off from a .lnk with a program location of g:\app\program.exe and start in of g:\

When I try to publish it from the connection broker it says the path does not exist. I also tried creating a batch file:

start "c:\users\public\desktop\program file.lnk" but that doesn't seem to do anything. If I run it from a session host I just get a command line.

Is it possible to make this work as a remote app?

Using Visual Basic NET to access Terminal Services Session and Client Information

$
0
0
This test program is being posted in case others have an interest in what proved to be a fairly difficult task of developing code that uses Visual Basic NET to access Terminal Services information.

The attached Visual Basic NET program accesses Terminal Services Session information.
It also accesses the Client Information for the client which executes this program on a Terminal Services Server.
The program has been compiled with Visual Studio 2005 and executed on Windows Server 2003
It has also been compiled with Visual Studio Orcas and executed on Windows Server 2007 (Longhorn Server).

Imports System.Runtime.InteropServices
'This is a test Visual Basic NET program that accesses Terminal Services Session information.
'It also accesses the Client Information for the client which executes this program on a TS Server.
'The program has been compiled with VisualStudio 2005 and executed on Windows Server 2003
'It has also been compiled with VisualStudio Orcas and executed on Windows Server 2007 (Longhorn Server).
'The program can be tested by creating a Windows console VB application with form1 and a button1 button.
'
'This program is based in part on code that is available from various Internet forums.
'Much credit and thanks are due to Eric Guerra, Microsoft Developer Support, who provided the
'solutions to a number of difficult programming issues.
'
'Note that there are specific issues with identifying a client IP address.
'Quoted from Microsoft at: http://msdn2.microsoft.com/en-us/library/aa383857.aspx
'The client network address is reported by the RDP client itself when it connects to the server.
'This could be different than the address that actually connected to the server.
'For example, suppose there is a NAT between the client and the server. The client
'can report its own IP address, but the IP address that actually connects to the server is
'the NAT address. For VPN connections, the IP address might not be discoverable by the client.
'If it cannot be discovered, the client can report the only IP address it has, which may be the
'ISP assigned address. Because the address may not be the actual network address, it should not
'be used as a form of client authentication.
'End Quote

Public Class Form1

    Private Enum WTS_CONNECTSTATE_CLASS
        WTSActive
        WTSConnected
        WTSConnectQuery
        WTSShadow
        WTSDisconnected
        WTSIdle
        WTSListen
        WTSReset
        WTSDown
        WTSInit
    End Enum

    <StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Auto)> _
    Private Structure WTS_SESSION_INFO
        Dim SessionID As Int32 'DWORD integer
        Dim pWinStationName As String ' integer LPTSTR - Pointer to a null-terminated string containing the name of the WinStation for this session
        Dim State As WTS_CONNECTSTATE_CLASS
    End Structure

    Friend Structure strSessionsInfo
        Dim SessionID As Integer
        Dim StationName As String
        Dim ConnectionState As String
    End Structure

    Private Enum WTS_INFO_CLASS
        WTSInitialProgram
        WTSApplicationName
        WTSWorkingDirectory
        WTSOEMId
        WTSSessionId
        WTSUserName
        WTSWinStationName
        WTSDomainName
        WTSConnectState
        WTSClientBuildNumber
        WTSClientName
        WTSClientDirectory
        WTSClientProductId
        WTSClientHardwareId
        WTSClientAddress
        WTSClientDisplay
        WTSClientProtocolType
        WTSIdleTime
        WTSLogonTime
        WTSIncomingBytes
        WTSOutgoingBytes
        WTSIncomingFrames
        WTSOutgoingFrames
    End Enum
    'Structure for TS Client IP Address
    <StructLayout(LayoutKind.Sequential)> _
    Private Structure _WTS_CLIENT_ADDRESS
        Public AddressFamily As Integer
        <MarshalAs(UnmanagedType.ByValArray, SizeConst:=20)> _
        Public Address As Byte()
    End Structure
    'Structure for TS Client Information
    Friend Structure WTS_CLIENT_INFO
        Public WTSStatus As Boolean
        Public WTSUserName As String
        Public WTSStationName As String
        Public WTSDomainName As String
        Public WTSClientName As String
        Public AddressFamily As Integer
        Public Address As Byte()
    End Structure

    'Function for TS Session Information excluding Client IP address
    Private Declare Function WTSQuerySessionInformation Lib "WtsApi32.dll" Alias "WTSQuerySessionInformationW" (ByVal hServer As Int32, _
    ByVal SessionId As Int32, ByVal WTSInfoClass As Int32, <MarshalAs(UnmanagedType.LPWStr)> ByRef ppBuffer As String, ByRef pCount As Int32) As Boolean

    'Function for TS Client IP Address
    Private Declare Function WTSQuerySessionInformation2 Lib "WtsApi32.dll" Alias "WTSQuerySessionInformationW" (ByVal hServer As Int32, _
      ByVal SessionId As Int32, ByVal WTSInfoClass As Int32, ByRef ppBuffer As IntPtr, ByRef pCount As Int32) As Boolean

    Private Declare Function GetCurrentProcessId Lib "Kernel32.dll" Alias "GetCurrentProcessId" () As Int32
    Private Declare Function ProcessIdToSessionId Lib "Kernel32.dll" Alias "ProcessIdToSessionId" (ByVal processID As Int32, ByRef sessionID As Int32) As Boolean
    Private Declare Function WTSGetActiveConsoleSessionId Lib "Kernel32.dll" Alias "WTSGetActiveConsoleSessionId" () As Int32


    <DllImport("wtsapi32.dll", _
    bestfitmapping:=True, _
    CallingConvention:=CallingConvention.StdCall, _
    CharSet:=CharSet.Auto, _
    EntryPoint:="WTSEnumerateSessions", _
    setlasterror:=True, _
    ThrowOnUnmappableChar:=True)> _
    Private Shared Function WTSEnumerateSessions( _
    ByVal hServer As IntPtr, _
    <MarshalAs(UnmanagedType.U4)> _
    ByVal Reserved As Int32, _
    <MarshalAs(UnmanagedType.U4)> _
    ByVal Vesrion As Int32, _
    ByRef ppSessionInfo As IntPtr, _
    <MarshalAs(UnmanagedType.U4)> _
    ByRef pCount As Int32) As Int32
    End Function

    <DllImport("wtsapi32.dll")> _
    Private Shared Sub WTSFreeMemory(ByVal pMemory As IntPtr)
    End Sub

    <DllImport("wtsapi32.dll", CharSet:=CharSet.Auto, SetLastError:=True)> _
     Private Shared Function WTSOpenServer(ByVal pServerName As String) As IntPtr
    End Function

    <DllImport("wtsapi32.dll", CharSet:=CharSet.Auto, SetLastError:=True)> _
     Private Shared Sub WTSCloseServer(ByVal hServer As IntPtr)
    End Sub

    Friend Function GetSessions(ByVal ServerName As String, ByRef ClientInfo As WTS_CLIENT_INFO) As Boolean
        Dim ptrOpenedServer As IntPtr
        Try
            ptrOpenedServer = WTSOpenServer(ServerName)
            If ptrOpenedServer = vbNull Then
                MessageBox.Show("Terminal Services not running on : " & ServerName)
                GetSessions = False
                Exit Function
            End If
            Dim FRetVal As Int32
            Dim ppSessionInfo As IntPtr = IntPtr.Zero
            Dim Count As Int32 = 0
            Try
                FRetVal = WTSEnumerateSessions(ptrOpenedServer, 0, 1, ppSessionInfo, Count)
                If FRetVal <> 0 Then
                    Dim sessionInfo() As WTS_SESSION_INFO = New WTS_SESSION_INFO(Count) {}
                    Dim i As Integer
                    Dim session_ptr As System.IntPtr
                    For i = 0 To Count - 1
                        session_ptr = ppSessionInfo.ToInt32() + (i * Marshal.SizeOf(sessionInfo(i)))
                        sessionInfo(i) = CType(Marshal.PtrToStructure(session_ptr, GetType(WTS_SESSION_INFO)), WTS_SESSION_INFO)
                    Next
                    WTSFreeMemory(ppSessionInfo)
                    Dim tmpArr(sessionInfo.GetUpperBound(0)) As strSessionsInfo
                    For i = 0 To tmpArr.GetUpperBound(0)
                        tmpArr(i).SessionID = sessionInfo(i).SessionID
                        tmpArr(i).StationName = sessionInfo(i).pWinStationName
                        tmpArr(i).ConnectionState = GetConnectionState(sessionInfo(i).State)
                        'MessageBox.Show(tmpArr(i).StationName & "  " & tmpArr(i).SessionID & "  " & tmpArr(i).ConnectionState)
                    Next
                    ReDim sessionInfo(-1)
                Else
                    Throw New ApplicationException("No data retruned")
                End If
            Catch ex As Exception
                Throw New Exception(ex.Message & vbCrLf & System.Runtime.InteropServices.Marshal.GetLastWin32Error)
            End Try
        Catch ex As Exception
            Throw New Exception(ex.Message)
            Exit Function
        Finally
        End Try
        'Get ProcessID of TS Session that executed this TS Session
        Dim active_process As Int32 = GetCurrentProcessId()
        Dim active_session As Int32 = 0
        Dim success1 As Boolean = ProcessIdToSessionId(active_process, active_session)
        If success1 = False Then
            MessageBox.Show("Error: ProcessIdToSessionId")
        End If
        Dim returned As Integer
        Dim str As String = ""
        Dim success As Boolean = False
        ClientInfo.WTSStationName = ""
        ClientInfo.WTSClientName = ""
        ClientInfo.Address(2) = 0
        ClientInfo.Address(3) = 0
        ClientInfo.Address(4) = 0
        ClientInfo.Address(5) = 0

        'Get User Name of this TS session
        If WTSQuerySessionInformation(ptrOpenedServer, active_session, WTS_INFO_CLASS.WTSUserName, str, returned) = True Then
            ClientInfo.WTSUserName = str
        End If

        'Get StationName of this TS session
        If WTSQuerySessionInformation(ptrOpenedServer, active_session, WTS_INFO_CLASS.WTSWinStationName, str, returned) = True Then
            ClientInfo.WTSStationName = str
        End If

        'Get Domain Name of this TS session
        If WTSQuerySessionInformation(ptrOpenedServer, active_session, WTS_INFO_CLASS.WTSDomainName, str, returned) = True Then
            ClientInfo.WTSDomainName = str
        End If

        'Skip client name and client address if this is a console session
        If ClientInfo.WTSStationName <> "Console" Then
            If WTSQuerySessionInformation(ptrOpenedServer, active_session, WTS_INFO_CLASS.WTSClientName, str, returned) = True Then
                ClientInfo.WTSClientName = str
            End If

            'Get client IP address
            Dim addr As IntPtr
            If WTSQuerySessionInformation2(ptrOpenedServer, active_session, WTS_INFO_CLASS.WTSClientAddress, addr, returned) = True Then
                Dim obj As New _WTS_CLIENT_ADDRESS()
                obj = CType(Marshal.PtrToStructure(addr, obj.GetType()), _WTS_CLIENT_ADDRESS)
                ClientInfo.Address(2) = obj.Address(2)
                ClientInfo.Address(3) = obj.Address(3)
                ClientInfo.Address(4) = obj.Address(4)
                ClientInfo.Address(5) = obj.Address(5)
            End If
        End If
        WTSCloseServer(ptrOpenedServer)
        Return True
    End Function

    Private Function GetConnectionState(ByVal State As WTS_CONNECTSTATE_CLASS) As String
        Dim RetVal As String
        Select Case State
            Case WTS_CONNECTSTATE_CLASS.WTSActive
                RetVal = "Active"
            Case WTS_CONNECTSTATE_CLASS.WTSConnected
                RetVal = "Connected"
            Case WTS_CONNECTSTATE_CLASS.WTSConnectQuery
                RetVal = "Query"
            Case WTS_CONNECTSTATE_CLASS.WTSDisconnected
                RetVal = "Disconnected"
            Case WTS_CONNECTSTATE_CLASS.WTSDown
                RetVal = "Down"
            Case WTS_CONNECTSTATE_CLASS.WTSIdle
                RetVal = "Idle"
            Case WTS_CONNECTSTATE_CLASS.WTSInit
                RetVal = "Initializing."
            Case WTS_CONNECTSTATE_CLASS.WTSListen
                RetVal = "Listen"
            Case WTS_CONNECTSTATE_CLASS.WTSReset
                RetVal = "reset"
            Case WTS_CONNECTSTATE_CLASS.WTSShadow
                RetVal = "Shadowing"
            Case Else
                RetVal = "Unknown connect state"
        End Select
        Return RetVal
    End Function

    Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim serverName As String
        Dim clientInfo As New WTS_CLIENT_INFO
        ReDim clientInfo.Address(20)
        serverName = ""
        'Server Name can be name of choice or name of server on which this application is running
        If GetSessions(serverName, clientInfo) = True Then
            Dim str As String
            str = "User Name: " & clientInfo.WTSUserName
            str &= vbNewLine & "Station Name: " & clientInfo.WTSStationName
            str &= vbNewLine & "Domain Name: " & clientInfo.WTSDomainName
            If clientInfo.WTSStationName <> "Console" Then
                str &= vbNewLine & "Client Name: " & clientInfo.WTSClientName
                str &= vbNewLine & "Client IP: " & clientInfo.Address(2) & "." & clientInfo.Address(3) & "." & clientInfo.Address(4) & "." & clientInfo.Address(5)
            End If
            MessageBox.Show(str)
        End If
    End Sub
End Class


[RDSH Workgroup 2012R2] initial program cannot be started

$
0
0

Hi,

I configured RDSH on a Windows Server 2012R2 in a Workgroup.

When connecting with a simple mstsc from a client, everything works fine.

When connecting from a .rdp edited to open a program, I've got the following error :

The system cannot find the file specified. This initial program cannot be started: %PATH%

Obviously, I've got to register my application or to configure my RDSH to allow users to start unlisted programs.

As my server is in a Workgroup, I can't access collections in the server manager, and the mmc snap in for RDSH has been deleted in Server 2012.

Do you know how I can solve this problem (by editing the registry or using a cmdlet maybe) ?

Thanks for your answers

EDIT : I found how to authorize unlisted applications in gpedit.msc : Computer configuration / Administrative Templates / Windows Components / Remote Desktop Session Host / Connections

Still searching how to create a list of authorized applications

TS2003 - Set up terminal server to open up one url only

$
0
0

We have a ws2003 terminal server with a 10 person user base as a workaround solution for one of our incompatible application.

How do you configure the settings so that

1. Runs an app (IE8) when a user logs into this termainal severs

2. Opens up a particular URL only

3. Hide the address bar when it's launch (so user can't access any other sites)

Thanks!

Non-Admin Users are unable to manage RDS 2012 R2 sessions

$
0
0

I've been trying to use a great script from the Gallery:
https://gallery.technet.microsoft.com/scriptcenter/Remotely-log-users-off-377c848d

It works great for me but I'm a Domain Admin.  I'm trying to enable my ERP admin as well as our help desk folks to manage user sessions.  We just want them to be able to send a message or log off a user(s).

Server Manager doesn't work because they get Access Denied on all of the hosts.

I understand the security but this defeats the purpose of having help desk staff when sys admins have to manage all facets of the RDS system.

Am I missing a setting or is this just not possible?

Server Manager Never Displays any data on Remote Desktop Services from machines

$
0
0

I've been working around this issue by building a utility machine that is in the same subnet as the brokers which does work.  I get mixed results depending on how I run Server Manager.

1.  Run as Administrator
When I run Server Manager as administrator here are the result:

Run as a regular user with admin credentials entered in Manage As for each RDS server including the 2 brokers listed:
I get the following message

As I said running them in either scenario on servers in the same subnet works without issue.

Some things that have been done recently
System Center Endpoint Protection has been enabled on all clients

Subnets have added to the closest sites in AD Sites and Services.  Both the client and brokers are in the same AD Site.

Any help is appreciated.


Open Doc File with Word via Remoteapp

$
0
0

Server 2012 with RDS. We publish office to some client pc's that do not have office installed locally. Is it possible to associate office files like doc, xls and so on so that when the user clicks to open an office file, the file will use the published office to open said files? I looked it the file associations of the published office apps on the server. Checked the boxes for doc and docx, updated the connection and tried to open a doc -> opened with wordpad and not the published word app. Is this possible?

All remote desktop sessions in my farm collection are 0

$
0
0

Hi all,

We do have a RDS farm with 2 session host servers. I have created a collection.
The collection is working fine, however when I want to "shadow" a session I receive an error: The specified session is not connected.

However I am sure it is connected, because I am doing I tried it myself using a test account on a different computer.
Then I couldn't find much in the event viewer or whatsoever. Then I came to realize that all RDS sessions do have session id 0, I can see that from the server manager, as well as when I use the powershell command.

Anyone experienced this problem before?

Is this host a terminal server?

$
0
0
Dear MS experts,

I am refurbishing a program that used to depend on a registry key /TSAppCompat to answer question "Is this host a terminal server?"  I am not seeing this key in Windows 7 and Server 2008 and would like your advice on best easy ways to answer this question using only "reg query" or other simple command-line mechanism.  If it still works in 2 years, that's even better.

Thanks!
-dave

Can't add existing VM to RDS Collection (Server 2012)

$
0
0

I have a Hyper-v server running Windows server 2012.  This server has the RD Virtualization Host role added (for remoteFX)

I have a VM running Server 2012 with RDS gateway/broker/web access/Licensing.

I can connect to my web interface/gateway and I can see a collection I created, when I try to connect to it, it errors because I don't have any VM's added to my collection (which brings me to my issue)

I created a Personal, unmanaged collection.  I wanted to add an existing Windows 8 RTM VM that I had created previously and assign it to myself.

But when I try to add it (or any other VM on the Hyper-v box) I get an error that I couldn't add the VM, but there is no reason why, no errors in the RDS event logs or system/app event logs.

Ideas?

Thanks


Server 2012 Terminal Services admin group config

$
0
0

We used to use tsconfig to configure an admin group of users that could disconnect/logoff other connected users. That seems to have gone away in 2012. I want to allow my support folks to be able to logoff our client users, but I don't want to have to add them as a local admin on the terminal servers, nor the service brokers. I have searched and not found how to do this with 2012, but was told that if I asked here, there is an improved way to do this. I am using a powershell script that my support folks will run, that would then disconnect/logoff the user. However, when it gets to the get-rdusersession, or invoke-rduserlogoff, the commands fail unless logged in as an administrator with the powershell being run as admin. I need to allow my support folks to be able to logoff the ts/rd users, without adding them as local admins on the server. How can I accomplish this with 2012?

Thanks in advance!

mpleaf

RemoteApp dont' work

$
0
0

Hello,

I would like to publish a remoteapp mais it doesn't work.

My application have this parameters :

Target : C:\usys72\Bin\UNIFACE.EXE /asn=config\contrat.asn /ini=config\contrat.ini CONTRAT

Start in : C:\inradi\contrat

Thanks

How to get information of which remote app is beign accessed in a RDP session

$
0
0

Suppose I have published remote app on a server, is there a way to know which user is using the remote app??

I tried to check with power shell , but found the Cmdlets for remote desktop, like to find the users who are currently connected or performing remote desktop, similarly do we have something for Remote apps? as even if I open 2 different remote apps from a pc they are maintained in 1 session. Do we have a way to maintain the Remote app launches from 1 pc  in different sessions??

Waiting for a reply on this.


--



Internet Explorer 10 on Terminal Services

$
0
0

Hi there,

I have installed terminal services on 2008R2. I want to virtualize IE10 to run on Windows 7 PCs, however when I run the application via RDWeb the current IE (which is IE11) loads.. Is there something I can do to load IE10 via TS?


Tux

See what application users have open on RDS

$
0
0

Hi All,

So we currently have a collection on our 2012 RDS infrastructure where we have 10 applications published to business.

I just want to find out if there is a means in which I can determine which application the users currently have open? The reason for this is we need to do a deployment to one of the published applications back-end application servers and need to ensure no users are connected to that specific application.

At the moment I have a total of 254 connections, yet I cannot determine if they are accessing App-1, App-2, App-3 etc.

Thanks,

How to open applications from one Server 2012 r2 on another Server with RDS Web

$
0
0

Hello All,

I am trying to open an application install on one server from another server. Both servers are 2012 r2 instances. When I try to open an application in RDS Web that is hosted on another server I get the error:

You must specify a file from the RD Session Host server "server_name" by using the UNC path; for example "UNC_Path\filename". if the problem persists, ensure that the following Windows Firewall exceptions are enabled:

1. File and Printer Sharing (SMB-Out).

2. File and Printer Shareing (SMB-In).

Firewall is off of server.  It seems to only search for files on the RDS Web server only. I tried using a batch file which seems to work but now I can not add icons to it and it gives the Windows error of an unknown program. 

Is there a better way to do this? I can launch any program from the server when navigating to its path.

Remote Desktop Web Apps stopped not opening on all mutliple monitors

$
0
0
We have server 2012 R2 Remote Desktop Services. Last week we could open the apps in all 6 screens we have ok. If I have all 6 monitors activated it will not allow us to move the different screens away from the main screen. If I disable three of the monitors it allows me to move my apps across all three screens ok. This is happening on Windows 7 pc So I tried updating to Windows 10 with same results.

How to Unassign or Removed an Assigned user from a Persistent or Personal Virtual Machine?

$
0
0

Hi,

 I have about 20 users with 20 persistent VMs in RDS Hyper-V host. Each user is assigned to his/her own personal VM so she can have a custom desktop look. I would like to un-assign or remove a user, how?

 Scenario: User Jessica's personal desktop "VDI-VM 2" has issues and I would like to remove her from the VM and assign her to "VDI-VM 21". I would like to keep VDI-VM2 for troubleshooting so I do not want to delete/remove it.

How would I perform this action?

Best,

Tuan

Viewing all 1106 articles
Browse latest View live