How to use CLIENTNAME environment variable in a Remote Desktop Session.

CDURK73 6 Reputation points
2022-11-08T23:12:27.857+00:00

We have a login script we use that requires the CLIENTNAME environment variable as we use this to apply default printers, locations and some other settings for an application we run on a Remote Desktop Server. On newer remote Desktop Servers running Server 2022 and 2019 this Environment variable no longer shows when you run the command "SET" from a command prompt.
We need to still be able to use this or find some way of allowing our script to "see" the ClientName environment variable. Any help would be very useful and much appreciated.

Windows for business | Windows Client for IT Pros | User experience | Remote desktop services and terminal services
Windows for business | Windows Server | User experience | Other
0 comments No comments
{count} vote

2 answers

Sort by: Most helpful
  1. CedPi 0 Reputation points
    2023-02-15T11:06:31.2666667+00:00

    Hi CDURK73,
    have you found any solution accoding this issue? I have the same problem whith testing win2022server on RDS.
    Kind regards

    0 comments No comments

  2. YOGESH YASWAL 0 Reputation points
    2024-01-02T13:15:59.79+00:00

    hi,

    I'm trying to remote desktop connection environment for when user connect remote desktop connection then after open a particular application. Because i don't want to access my desktop. and some user can access my desktop through remote desktop connection.

    please give me a solution how to do it in windows server 2016 and above

    my email id is - ******@hotmail.com

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.