Announcement

Collapse
No announcement yet.

VBScript to run in RDP session ONLY

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • VBScript to run in RDP session ONLY

    Hi all,

    Windows 2003 AD in Native mode. XP Pro workstations.

    I need a script to map a drive to users ONLY when they log into their Terminal Server session. It must not execute when they log into the AD from their PC. I know how to do the oposite - have the script run only from the AD (PC) login and not the session using the "CONSOLE" string:

    if strSession = CONSOLE Then...

    But I can't figure out what it takes to have it run only in the Terminal Server session. Is there a constant for SESSION as there is for CONSOLE?

    Any help would go a long ways towards me keeping some semblance of sanity...thanks in advance.

    Robert

  • #2
    Re: VBScript to run in RDP session ONLY

    Similar Thread:
    Need help with GP login script, rcastro

    Code:
    Const CONSOLE = "CONSOLE"
    Set oShell = CreateObject( "WScript.Shell" )
    strSession = _
      UCase(oShell.ExpandEnvironmentStrings("%SESSIONNAME%"))
    If strSession = CONSOLE Then 
      ' Add the console logonscript code here
    Else
      ' Add the RDP logonscript code here
    End If
    Or,
    for just the RDP logonscript,
    If NOT strSession = CONSOLE Then


    \Rems

    This posting is provided "AS IS" with no warranties, and confers no rights.

    __________________

    ** Remember to give credit where credit's due **
    and leave Reputation Points for meaningful posts

    Comment

    Working...
    X