You are here: TWiki> Online Web>WinExe (2008-07-28, mazurov)
Tags:
create new tag
, view all tags

Winexe program — remotely executes commands on WindowsNT/2000/XP/2003 systems from GNU/Linux

Usage

winexe version 0.80
This program may be freely redistributed under the terms of the GNU GPL
Usage: winexe [-?] [-?] [-?] [-?NP] [-?NPV] [-?|--help] [--usage] [-d|--debuglevel DEBUGLEVEL]
        [--debug-stderr] [-s|--configfile CONFIGFILE] [--option=name=value]
        [-l|--log-basename LOGFILEBASE] [--leak-report] [--leak-report-full]
        [-R|--name-resolve NAME-RESOLVE-ORDER]
        [-O|--socket-options SOCKETOPTIONS] [-n|--netbiosname NETBIOSNAME]
        [-W|--workgroup WORKGROUP] [--realm=REALM] [-i|--scope SCOPE]
        [-m|--maxprotocol MAXPROTOCOL] [-U|--user [DOMAIN\]USERNAME[%PASSWORD]]
        [-N|--no-pass] [--password=STRING] [-A|--authentication-file FILE]
        [-S|--signing on|off|required] [-P|--machine-pass]
        [--simple-bind-dn=STRING] [-k|--kerberos STRING]
        [--use-security-mechanisms=STRING] [-V|--version] [--uninstall]
        [--reinstall] [--system] [--runas=[DOMAIN\]USERNAME%PASSWORD]
        [--interactive=INT] //host command

winexe specific

Option Description
host Windows hostname provided as ip address or DNS name. Using NETBIOS names should be also possible after playing with Samba specific options.
command Command which will be run on remote system. If command contains spaces and/or parameters use quotes and/or double quotes, ex. '"long name.exe" -option -"option with spaces"', if you like to run internal cmd interpreter command use "cmd /C" syntax, ex. "cmd /C ver". If command interact with desktop GUI check option --interactive.
--uninstall Uninstall winexesvc service after remote execution
--reinstall Reinstall winexesvc service before remote execution
--system Run command using SYSTEM account
--runas=[DOMAIN/]USERNAME%PASSWORD Run command as user (BEWARE: password is sent in cleartext over net)
--interactive=0 or 1 Desktop interaction: 0 - disallow, 1 - allow. If you allow use also --system switch (Win requirement). Windows Vista do not support this option.

General

Option Description
-U [DOMAIN/]USERNAME[%PASSWORD] User with admin privileges for Windows authentication. If not overrided by other options 'command' will be run on this account. If you omit password you will be prompted.
-d DEBUGLEVEL Set debug level, 0 - no debug (default), 11 - highest level (it is safe to use bigger numbers)

Exit code: winexe returns exit code of remote process.

Example

/group/online/scripts/winexe -U LHCB/USER_NAME  //ts01 "ipconfig /all"

Links

-- AlexanderMazurov - 28 Jul 2008

Topic revision: r1 - 2008-07-28 - mazurov
 

TWIKI.NET
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback