Idiomes

Desconnectant usuaris de l'escriptori remot (terminal server) de windows

Intentes connectar-te via remote desktop (terminal server) al servidor, però et trobes que ja hi ha gent connectada. El maleït missatge:

You can't connect!

Què fer en aquest cas? Doncs molt senzill. Donat que tenim la nostra flamant eina winexe , podem fer un petit script que ens faciliti la vida:

#!/bin/bash

[ $# -lt 1 ] && echo "Error: Missing argument" && echo "Use: $0 server [disc #session]" && exit

[ ! -z "$2" ] && [ $2 != disc ] && echo "Error: Can't understand second argument" && echo "Use: $0 server [disc #session]" && exit
[ "$2" == "disc" ] && echo "Disconnecting session $3 from server $1..." && winexe //$1 "logoff $3" -A secretfile && exit
echo "Listing server $1 sessions:"
winexe //$1 "query session" -A secretfile

L'arxiu "secretfile" és opcional, és per no haver de posar usuari i contrassenya. El seu contingut és aquest:

domain=YOURDOMAIN
username=user
password=pass

Es un script sense gaire control d'errors, pero et permet veure qui hi ha connectat:

user@server:~/$ ts.sh server2
Listing server server2 sessions:
SESSIONNAME       USERNAME                 ID  STATE   TYPE        DEVICE
>                            user1                          0    Disc    rdpwd
rdp-tcp                                 65536  Listen  rdpwd
                   Administrator             3  Disc    rdpwd
                   user2                     1  Disc    rdpwd
console                                     5  Conn    wdcon
user@server:~/$

En aquest servidor ja no s'hi pot entrar. Veiem que tothom esta en estat "disconnected", amb la qual cosa no hi ha ningú treballant. Escollim l'usuari que ens caigui pitjor, i el fem fora:

user@server:~/$ ts.sh server2 disc 1
Disconnecting session 1 from server server2...
user@server:~/$ ts.sh server2
Listing server server2 sessions:
SESSIONNAME       USERNAME                 ID  STATE   TYPE        DEVICE
>                  user1                  0  Disc    rdpwd
rdp-tcp                                 65536  Listen  rdpwd
                   Administrator             3  Disc    rdpwd
console                                     5  Conn    wdcon

Et voilà! ja tenim una sessió lliure per connectar-nos a administrar aquest servidor.

Evidentment és molt millor que tothom tanqui el terminal server quan acabi de treballar. Però si has de compartir servidors amb despistats, t'has de buscar la vida...

AdjuntMida
error.PNG3.82 KB
ts.sh445 bytes

Comments

silver tiffany

Tiffany not only explored the various jewelry processes of the time, but also branched out into new metals, such as platinum, which at the time was considered very hard to manipulate.It seems to be the case that unusual colorations appealed to Tiffany, like the opal.He also preferred gemstones that were either opaque or translucent. Turquoise, jade, carnelian, lapis, moonstones, and opals were all chosen for their ability to filter light. Emphasis based on color was very prevalent in his works.Silver TiffanyHe devoted hi s first year of jewelry making to mainly a focus towards forms and techniques, and only began to really put a collection together once he was satisfied with the fruits of his labor.Once Tiffany and Co.’s began to manufacture his jewelry, there was a marked evolution in his pieces. His earlier pieces went from being made in a “hand-wrought” looking manner, to a much more symmetrical and stylized fashion. There was a great variety of jewelry that was produced during the 26 years that Louis Tiffany’s enameling and jewelry division was in operation at Tiffany & Co. It has been estimated that nearly 5,500 pieces were produced during that time, an impressive amount considering the detail and craftsmanship in each piece.He was produced the same high-quality artisanship that was very prized during the Arts and Crafts movement.