Windows XP in a domain as a Terminal Server (Linux way)

    Windows job administrators know what kind of trouble this is in Mon. in the morning, suddenly expel
    all users from sessions and urgently update domestic software. Exit - simultaneous work in Windows XP user and administrator.
    Recipes on the Internet are a little inaccurate, designed for a mouse, don’t work in a domain, they don’t know what else - choose X from Y.
    We’ll make the right tool from well-known materials that works simply, quickly and without a mouse (Linux way, yes).
    Note: legal issues are not considered.


    1. Purpose of work


    1. Replace the desired dll
    2. Correct / add registry keys
    3. Ensure restoration of the status quo after overload

    2. Devices and materials


    1. Windows XP in the domain
    2. Corrected 3 bytes of termsrv.dll of the desired version (on the Internet )
    3. srvany.exe (in some ResourceKit or separately )
    4. instsrv.exe (ibid.)
    5. Create two body shirts (with hands)

    We put everything in one [network] folder and joyfully straighten the handles.

    3. Progress



    Do it once

    1.cmd:
    @ECHO "1. SFC off"
    @REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v SFCDisable /t REG_DWORD /d 00000001 /f
    @ECHO "2. Terminal service off"
    @REG ADD "HKLM\SYSTEM\CurrentControlSet\Services\TermService" /v Start /t REG_DWORD /d 00000004 /f
    @PAUSE
    

    > 1.cmd && shutdown -t 0 -r

    Do two

    2.cmd:
    @REM store src path (w/ trailing slash)
    @SET ROOT=%~dp0
    @ECHO "1. Copy files"
    @ECHO "termsrv.dll..."
    @copy /y %ROOT%termsrv.dll %WINDIR%\ServicePackFiles\i386\
    @copy /y %ROOT%termsrv.dll %WINDIR%\System32\dllcache\
    @copy /y %ROOT%termsrv.dll %WINDIR%\System32\
    @ECHO "srvany.exe..."
    @copy /y %ROOT%srvany.exe %WINDIR%\
    @ECHO "2. Create service to reenable multisession"
    %ROOT%instsrv.exe TS "%WINDIR%\srvany.exe"
    @ECHO "3. Modify registry"
    @ECHO "Enable TS..."
    @REG ADD "HKLM\SYSTEM\ControlSet001\Control\Terminal Server\Licensing Core" /v EnableConcurrentSessions /t REG_DWORD /d 00000001 /f
    @REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v EnableConcurrentSessions /t REG_DWORD /d 00000001 /f
    @REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v AllowMultipleTSSessions /t REG_DWORD /d 00000001 /f
    @REG ADD "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /v MaxInstanceCount /t REG_DWORD /d 00000007 /f
    @ECHO "Tune our service..."
    @REG ADD "HKLM\SYSTEM\CurrentControlSet\Services\TS\Parameters" /v Application /t REG_SZ /d "REG ADD \"HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\" /v AllowMultipleTSSessions /t REG_DWORD /d 00000001 /f" /f
    @ECHO "4. Terminal service on (2=auto)"
    @REG ADD "HKLM\SYSTEM\CurrentControlSet\Services\TermService" /v Start /t REG_DWORD /d 00000002 /f
    @ECHO "5. SFC on"
    @REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v SFCDisable /t REG_DWORD /d 00000000 /f
    @PAUSE
    

    > 2.cmd && shutdown -t 0 -r

    4. Conclusions


    • SFC still works, but you can just send it. Who will help to fix - welcome.
    • Double overload is needed due to the TermServer service.
    • Instsrv can be replaced by importing a registry branch.
    • In a good way, it would be necessary to do checks everywhere. But cmd is not for you bash, but I had no time to understand almost undocumented software with enchanting syntax. As a compensation - both body shirts are safe enough - you can run in any order any number of times, they won’t do too much. But who can help rectify the situation - welcome.
    • The installed TS service continues to be “executed” all the time, which is also ugly. But the dock is silent.
    • Why is everything like this, and not otherwise - the anon can google / try it yourself.

    Also popular now: