четверг, 18 марта 2010 г.

Удаленная перезагрузка windows из под linux

linux debian
windows server 2003
Необходимо, чтобы в linux был пакет samba-common.
Если нет, то устанавливаем:
sudo apt-get install samba-common
Выключение windows:
net rpc shutdown -I [ip адресс] -U login%password
Если перезагрузка, то параметр -r

Все параметры данной команды:

net rpc info show basic info about a domain
net rpc join to join a domain
net rpc oldjoin to join a domain created in server manager
net rpc testjoin tests that a join is valid
net rpc user to add, delete and list users
net rpc password [] -Uadmin_username%admin_pass
net rpc group to list groups
net rpc share to add, delete, list and migrate shares
net rpc printer to list and migrate printers
net rpc file to list open files
net rpc changetrustpw to change the trust account password
net rpc getsid fetch the domain sid into the local secrets.tdb
net rpc vampire syncronise an NT PDC’s users and groups into the local passdb
net rpc samdump diplay an NT PDC’s users, groups and other data
net rpc trustdom to create trusting domain’s account or establish trust
net rpc abortshutdown to abort the shutdown of a remote server
net rpc shutdown to shutdown a remote server
net rpc rights to manage privileges assigned to SIDs
net rpc registry to manage registry hives
net rpc service to start, stop and query services
net rpc audit to modify global auditing settings
net rpc shell to open an interactive shell for remote server/account management

‘net rpc shutdown’ also accepts the following miscellaneous options:
-r or –reboot request remote server reboot on shutdown
-f or –force request the remote server force its shutdown
-t or –timeout= number of seconds before shutdown
-C or –comment= text message to display on impending shutdown