How to Connect to Windows Admin Session via RDP on Mac (Equivalent to mstsc /admin)


2 views

When working with remote Windows servers from Mac OS X, administrators often need to access the special console session (Session ID 0) - what Windows users know as the "/admin" switch in mstsc.exe. This session is crucial for:

  • Direct hardware access
  • System-level troubleshooting
  • Services that only run in console session

The official Microsoft Remote Desktop client (version 10.3.7+) for Mac supports this functionality through its configuration file:


{
    "sessionName": "Admin Console",
    "hostName": "your-server-ip",
    "userName": "administrator",
    "consoleSession": true,
    "resolution": "1920x1080"
}

For older versions or third-party clients, try these approaches:

1. Using Command Line (Terminal)


open -a "Microsoft Remote Desktop" --args /admin server-name

2. AppleScript Automation


tell application "Microsoft Remote Desktop"
    activate
    tell application "System Events"
        keystroke "n" using command down
        delay 1
        keystroke "your-server-ip"
        keystroke tab
        keystroke "administrator"
        keystroke tab
        keystroke "password"
        keystroke tab
        key code 126 -- up arrow for console session
        keystroke return
    end tell
end tell
  • Ensure "Restricted Administration mode" is disabled in Windows Group Policy
  • Verify your account has "Allow logon through Remote Desktop Services" rights
  • Check Windows Firewall allows RDP connections (TCP 3389)

For persistent connections, modify the RDP file directly:


screen mode id:i:2
use multimon:i:1
desktopwidth:i:1920
desktopheight:i:1080
session bpp:i:32
winposstr:s:0,1,0,0,800,600
compression:i:1
keyboardhook:i:2
audiocapturemode:i:0
videoplaybackmode:i:1
connection type:i:7
networkautodetect:i:1
bandwidthautodetect:i:1
displayconnectionbar:i:1
enableworkspacereconnect:i:0
disable wallpaper:i:1
allow font smoothing:i:1
allow desktop composition:i:0
disable full window drag:i:1
disable menu anims:i:1
disable themes:i:0
disable cursor setting:i:0
bitmapcachepersistenable:i:1
administrative session:i:1

The critical line is administrative session:i:1 which forces console connection.


When working with remote servers, Windows administrators frequently use mstsc /admin to connect directly to the console session. This becomes particularly important when troubleshooting or when regular remote sessions aren't available. However, Mac users leveraging Microsoft's Remote Desktop client often struggle to find this equivalent functionality.

Microsoft Remote Desktop for Mac (version 10.3.7 and later) includes this capability, though it's not immediately obvious. Here's how to access it:


1. Open Microsoft Remote Desktop
2. Click the "+" button and select "Desktop"
3. In the connection settings, look for "Connect to admin session"
4. Check this option before connecting

For those who need to automate this process, here's an AppleScript example that creates a new admin session connection:


tell application "Microsoft Remote Desktop"
    activate
    set newDesktop to make new desktop
    tell newDesktop
        set hostname to "your.server.address"
        set username to "adminuser"
        set adminSession to true
    end tell
    connect newDesktop
end tell

Power users can leverage the command line interface:


open -a "Microsoft Remote Desktop" --args connect "rdp://full%20address=s:yourserver&admin session=i:1"
  • Ensure you're using at least version 10.3.7 of Microsoft Remote Desktop
  • Admin sessions count against your terminal server license differently
  • Some Group Policy settings might prevent admin session access
  • You'll need proper administrative credentials

If you're unable to establish an admin session:

  1. Verify your user has console session access rights
  2. Check the server's RDP-Tcp properties in Terminal Services Configuration
  3. Try connecting from a Windows machine first to rule out credential issues
  4. Examine the server's event logs for connection attempts