注:需要workstation服務支持
獲取當前IPC連接列表
net use
建立遠程IPC連接
net use \\192.168.1.118\ipc$ "Password" /user:"UserName"
刪除指定IPC連接
net use \\192.168.1.118\ipc$ /del
刪除所有IPC連接
net use * /del
創建映射分區
net use z: \\192.168.1.118 \c
刪除映射分區
net use z: /del
復制文件到遠程主機
copy c:\script.bat \\192.168.1.118\c$
添加計划任務到遠程主機
at \\192.168.1.118 09:00 c:\script.bat
NET USER用戶操作命令
在本地添加帳戶
net user 帳戶名 密碼 /add
激活禁用的用戶
net uesr 帳戶名 /active:yes
加入管理員組
net localgroup administrators 帳戶名 /add
遠程關機
重啟 shutdown /m \\192.168.1.118 /r /t 0
關機 shutdown /m \\192.168.1.118 /s /t 0
SC 服務操作命令
創建服務
sc create ServiceName binPath= " c:\script.bat\ " start= demand
設置服務為手動狀態
sc \\192.168.1.118 config RemoteRegistry start= demand
啟動服務
sc \\192.168.1.118 start RemoteRegistry
結束服務
sc \\192.168.1.118 stop RemoteRegistry
刪除服務
sc \\192.168.1.118 delete RemoteRegistry
刪除默認共享
net share c$ /delete
禁止自動打開默認共享
Server版本
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters]
把AutoShareServer(DWORD)的鍵值改為:00000000
Workstation版本
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters]
把AutoShareWks(DWORD)的鍵值改為:00000000
IPC連接基於139,445端口
139端口可以通過禁止NBT來屏蔽
本地連接-TCP/IT屬性-高級-WINS-選 禁用TCP/IT上的NETBIOS
445端口可以通過修改注冊表來屏蔽
添加一個鍵值
Hive: HKEY_LOCAL_MACHINE
Key: System\Controlset\Services\NetBT\Parameters
Name: SMBDeviceEnabled
Type: REG_DWORD
Value: 0
遠程重啟服務器
shutdown /r /f /m \\192.168.10.251 /t 0