BAT Management mstsc Remote Desktop Connection

Source: Internet
Author: User
Tags mstsc

Bulk Add Users


@echo off

Set "User name file =a.txt"

Set "user group name =administrators"

:: File path can have spaces, but no extra "quotes" required

for/f "Usebackq tokens=1-3"%%a in ("% User name file%") do (

NET user%%a%%b/add/passwordchg:%%c

net localgroup% user group name%%%a/add

)

Echo, user add complete!

Pause>nul&exit

SA passwd110 No

GX passwd123 No

FP passwd456 No



Mstsc-v IP

Because the default limit is limited to 2 user access, the following actions are required:

Issue: Terminal Server exceeds maximum allowed number of links

Solution: This is a lot of ways, if you need to log on the server immediately, the most easy way is:


Start-run-mstsc/console/v: server name or IP or domain name: Remote port:

such as: mstsc/console/v:222.222.215.222:3389

Cause: When you log on to a terminal server with a Remote Desktop link, you often encounter a "terminal server exceeding the maximum allowed links" error that causes the Terminal server to log on incorrectly, causing the problem because the default number of links for Terminal Services is 2 links, and if you log out of the Remote Desktop without logging out, Instead of shutting down the Remote Desktop window directly, the session is actually not released, but continues on the server side, which will take up the total number of links, and the above hint will appear when the number reaches the maximum allowable value.


Five steps to avoid landing error

first, log out of the Remote desktop instead of closing the window directly

Open Control Panel, double click Add Remove Programs, click Add Remove Windows Components, components, in the Windows Components Wizard dialog box, select Terminal Services, Next, Application Server, Next, and then follow the prompts to change the Terminal Services mode.

Windows 2000 Terminal Services has 2 modes of Operation: Remote Administration mode and Application Server mode. Remote Administration mode allows the system administrator to remotely administer the server and allow only 2 terminal sessions to log on to the Terminal server at the same time. Application Server mode allows users to run more than one application, allowing multiple users to log on from the terminal to access the server. However, the user who applies Terminal Services must have Terminal Services licensing, that is, the Terminal Services Licensing server must be set up within 90 days in this domain or workgroup, or the user will need to remove the application before reinstalling it.

Ii. Limit the time that a disconnected session exists

1. Modify from Terminal Services Configuration

Run-tscc.msc (Terminal Services Configuration)-Connect-double-click Rdp-tcp or right-click-Properties-session-Select the first alternative user setting (O)-end a disconnected session [change the default value from never to an appropriate time, such as 30 minutes]

2. Modify from Group Policy

Start-run-gpedit.msc-Computer Configuration-Administrative Templates-windows components-Terminal Services-sessions

Right window select Set time limit for disconnected sessions-select enabled, select a time

third, increase the maximum number of links

1, modify from Terminal Services Configuration: Run-tscc.msc (Terminal Services Configuration)-Connect-double-click Rdp-tcp or right-click-Properties, select "Network Card" tab-Modify "Maximum number of connections" To change the value you want, of course, this value can not be too large, otherwise it will occupy more system resources. However, the value modified here does not seem to work, and when set to No limit, the situation described in this article will still occur.

2, Group Policy level is higher than Terminal Services configuration, when Group Policy is enabled, the corresponding options in the Terminal Services configuration will be grayed and non-modifiable

Run-gpedit.msc-Computer Configuration-Administrative Templates-windows components-Terminal Services

Double-click Limit number of connections on the right-select enabled-fill in the maximum number of connections allowed

Four, change the remote terminal mode

Recommended Use:

Start-Administrative Tools-Terminal Services Configuration-server configuration-restrict the use of one session per user

V. Modifying the Local Security policy

Control Panel >> Administrative Tools >> Local Security policy >> Local Policies >> security options >>

1. Locate the >>microsoft network server first: The idle time required before the session is suspended

The default is: 15 minutes, instead of the time you need (that is, no action after landing after more than how much time after the automatic disconnection)

2. Then find >> Network security: Force logoff after logon hours are exceeded. The default is: Disabled, be sure to change to: Enabled

Some of the mstsc parameters are described below:

MSTSC (Microsoft Terminal Services Client)

MSTSC is connected to a remote client by using Microsoft's Remote Desktop Protocol (remotely desktops Protocol, abbreviated as RDP), while the RDP for Windows XP has a connection limit of 1 concurrent numbers. For each user, the. rdp file is stored as a hidden file in My Documents.

Create a connection to a terminal server or other remote computer, edit an existing Remote Desktop Connection (. rdp) profile, and migrate the Windows XP connection (using the connection created by Client Connection Manager) to a new. rdp file.

MSTSC syntax

mstsc.exe {connectionfile|/v:server} [/console] [/f] [/w:width/h:height]
Mstsc.exe/edit "ConnectionFile"
Mstsc.exe/migrate

MSTSC parameters

CONNECTIONFILE Specifies the name of the. rdp file to use for the connection
/v:server[;p ORT] Specifies the remote computer to connect to
/admin will connect to session to manage server
/f Start the Remote Desktop Connection in full-screen mode
/w:width specifying the width of the Remote Desktop window
/h:height Specify the height of the Remote Desktop window
/public running Remote Desktop in common mode
/span is the height and width of the remote computer that matches the local virtual desktop, and expands to multiple displays if necessary. To extend to multiple displays, all displays must have the same height and are arranged vertically
/console connecting to a console session that specifies Windows Server
/edit opening the specified. rdp file for editing
/migrate Migrating legacy connection files created with Client Connection Manager to a new. RDP connection File

If you feel more trouble, you can use the remote terminal to strengthen the version, force login


This article is from the "lake and Laughter" blog, please make sure to keep this source http://hashlinux.blog.51cto.com/9647696/1870616

BAT Management mstsc Remote Desktop Connection

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.