Jump to content

Recommended Posts

Posted
#include <GUIConstantsEx.au3>


SoundPlay("shadow.wav")


    
    
Local $name = InputBox("Server Name", "Input server name ", "google.com", "", _
                         - 1, -1, 780, 312)
                         If @error Then Return
                             




Remote()

Func remote()
    ; Main Accounts
    Local $main =   GUICreate("Shadow Remote v1.2",400,350,700,200)


    GUICtrlCreatePic("logo.jpg", 0, 0, 400, 350)
    GUICtrlSetState(-1,$GUI_DISABLE)

    
    Local $qwinsta=  GUICtrlCreateButton ("Open Sessions",50,60,80,20)
    GUICtrlSetBkColor(-1, 0xFFFFFF)


    Local $connect =     GUICtrlCreateButton ("Connect Session",260,60,90,20)
    GUICtrlSetBkColor(-1, 0xFFFFFF)
    Local $kill =    GUICtrlCreateButton ("Close Session",260,90,90,20)
    GUICtrlSetBkColor(-1, 0xFFFFFF)
    Local $end = GUICtrlCreateButton("Terminate", 160, 280, 80, 20)
    GUICtrlSetBkColor(-1, 0xFFFFFF)







    ; Display the GUI.
    GUISetState(@SW_SHOW, $main)

    Local $iPID = 0


    ; Loop until the user exits.
    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE

                ExitLoop

                ;main cases
            case $qwinsta
$iPID = qwinsta()

            case $connect       
$iPID = connect()

            case $kill
$iPID = kill()

            case $end            
$iPID = end()




        EndSwitch
    WEnd

    ; Delete the previous GUI and all controls.
    GUIDelete($main)
EndFunc   ;==>Example


 ;main functions
Func qwinsta()


Run(@ComSpec & ' /k qwinsta.bat')
Sleep(5000)
Send("{space}")

EndFunc

Func connect()

    Local $session = InputBox("Session", "Input session number ", "", "", _
                         - 1, -1, 780, 312)
    $cmd= "MSTSC /Shadow:" & $session & " /Control /NoConsentPrompt"
    If @error Then Return
    
RunWait('"' & @ComSpec & '" /k ' & $cmd)
Sleep(1000)
Send("exit")
Send("{enter}")

EndFunc

                         
Func kill()

    Local $session = InputBox("Session", "Input session number ", "", "", _
                         - 1, -1, 780, 312)
    $cmd= "rwinsta /server:" & $name & " " & $session 
    If @error Then Return
        


    
RunWait('"' & @ComSpec & '" /k ' & $cmd)



EndFunc


Func end()
    SoundPlay("shadow.wav")
    sleep(2200)
exit
EndFunc

A GUI  for server admins to connect a user´s session  as admin without 3rd party software , previously is need to edit a GPO. I share it  if anyone finds it useful or make it better.

 

gpo.jpeg

qwinsta.bat

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...