Net Command

許多 Windows NT 網絡命令以 net 開始。這些 net 命令有一些公共屬性,通過鍵入 net /? 可查閱所有可用的 net 命令。 通過鍵入 net help 命令可在命令行中獲得 net 命令的語法幫助。例如,要得到 net accounts 命令的幫助,請鍵入 net help accounts 所有 net 命令接受選項 / yes 和 /no(可縮寫為 / y 和 /n )。/ y 對命令產生的任何交互提示自動回答「是」,/n 回答「否」。

例如,net stop server 通常提示確認是否根據服務器服務結束所有服務,net stop server /y 自動回答「是」並關閉服務器服務。

  • Net Accounts

更新用戶帳號數據庫、更改密碼及所有帳號的登錄要求。必須要在更改帳號參數的計算機上運行網絡登錄服務。 net accounts [/forcelogoff:{minutes | no}] [/minpwlen:length] [/maxpwage:{days | unlimited}] [/minpwage:days] [/uniquepw:number] [/domain] net accounts [/sync] [/domain] 鍵入不帶參數的 net accounts,將顯示當前密碼設置、登錄時限及域信息。 如圖:

Net Command - Y偉 - chunwaihome 的博客 /forcelogoff:{minutes | no}
設置當用戶帳號或有效登錄時間過期時,結束用戶和服務器會話前的等待時間。no 選項禁止強行註銷。該參數的默認設置為 no。

/minpwlen:length
設置用戶帳號密碼的最少字符數。允許範圍是 0-14,默認值為 6。 /maxpwage:{days | unlimited}
設置用戶帳號密碼有效的最大天數。unlimited 不設置最大天數

/minpwage:days
設置用戶必須保持原密碼的最小天數。 0 值不設置最小時間。允許範圍是 0-49,710 天,默認值為 0 天。 /uniquepw:number 要求用戶更改密碼時,必須在經過 number 次後,才能重複使用與之相同的密碼。允許範圍是 0-8。默認值為 5。

  • Net Computer

從域數據庫中添加或刪除計算機。該命令僅在運行 Windows NT Server 的計算機上可用。 net computer \computername {/add | /del}

  • Net Config

顯示當前運行的可配置服務,或顯示並更改某項服務的設置。 net config [service [options]]

Net Config Server

運行服務時顯示或更改服務器的服務設置。 net config server [/autodisconnect:time] [/srvcomment:"text "] [/hidden:{yes | no}]

Net Config Workstation

服務運行時,顯示或更改工作站各項服務的設置。 net config workstation [/charcount:bytes] [/chartime:msec] [/charwait:sec]

  • Net Continue

重新激活掛起的服務。 net continue service 參數 service 能夠繼續運行的服務,包括: file server for macintosh(該服務僅限於 Windows NT Server), ftp publishing service, lpdsvc, net logon, network ddenetwork dde dsdmnt lm security support providerremoteboot(該服務僅限於 Windows NT Server),remote access server, scheduleserversimple tcp/ip servicesworkstation

  • Net File

顯示某服務器上所有打開的共享文件名及鎖定文件數。該命令也可以關閉個別文件並取消文件鎖定。 net file [id [/close]]

  • Net Localgroup

添加、顯示或更改本地組。 net localgroup [groupname [/comment:"text "]] [/domain]
net localgroup groupname {/add [/comment:"text "] | /delete} [/domain]
net localgroup groupname name [ ...] {/add | /delete} [/domain]

groupname 要添加、擴充或刪除的本地組名稱。只提供 groupname 即可查看用戶列表或本地組中的全局組。

例如在本地機中新增名為axa的群組,執行命令

net localgroup axa /add

將帳戶John加進Administrators群組裏

net localgroup administrators John /add

  • Net user

作用:添加或更改用户账号或显示用户账号信息。

格式:net user username password | *options/domain

参数:(1)键入不带参数的net user查看计算机上的用户账号列表。

(2)user name添加、删除、更改或查看用户账号名。

(3)password为用户账号分配或更改密码。

(4)*提示输入密码。

(5)/domain在计算机主域的主域控制器中执行操作。

  • Net Pause

暫停正在運行的服務。 net pause service 參數 service 指下列服務: file server for macintosh(僅限於 Windows NT Server)、ftp publishing service、lpdsvc、net logon、network dde、network dde dsdm、nt lm security support provider、remoteboot(僅限於 Windows NT Server)、remote access server、schedule、server、simple tcp/ip services 或 workstation 。

  • Net Print

顯示或控制打印作業及打印隊列。 net print \computername sharename net print [\computername ] job# [/hold | /release | /delete]

  • Net Session

列出或斷開本地計算機和與之連接的客戶端的會話。 net session [\computername] [/delete]

  • Net Share

创建、删除或显示共享资源。   net share sharename=drive:path [/users:number | /unlimited] [/remark:"text"]   net share sharename [/users:number | unlimited] [/remark:"text"]   net share {sharename | drive:path} /delete

例子:

net share incoming = u:\incoming

net share incoming /delete

  • Net Start

啟動服務,或顯示已啟動服務的列表。如果服務名是兩個或兩個以上的詞,如 Net Logon 或Computer Browser,則必須用引號 (") 引住。. net start [service] service 包括下列服務:

alerter、client service for netware、clipbook server、computer browser、dhcp client 、directory replicator 、eventlog 、ftp publishing service 、lpdsvc、messenger 、net logon 、network dde 、network dde dsdm 、network monitoring agent 、nt lm security support provider 、ole 、remote access connection manager 、remote access isnsap service 、remote access server 、remote procedure call (rpc) locator 、remote procedure call (rpc) service 、schedule 、server 、simple tcp/ip services 、snmp、spooler 、tcp/ip netbios helper 、ups 及 workstation

下列服務僅在 Windows NT Server 下可用:file server for macintosh、gateway service for netware、microsoft dhcp server、print server for macintosh、remoteboot、windows internet name service 。

  • Net Statistics

顯示本地工作站或服務器服務的統計記錄。 net statistics [workstation | server]

workstation 顯示本地工作站服務的統計信息。 server 顯示本地服務器服務的統計信息。

  • Net Stop

停止 Windows NT 網絡服務。 net stop service

  • Net Time

net time [\computername | /domain[:name]] [/set]

參數 \computername 要檢查或同步的服務器名。 /domain[:name] 指定要與其時間同步的域。
/set 使本計算機時鐘與指定計算機或域的時鐘同步。

  • Net Use

連接計算機或斷開計算機與共享資源的連接,或顯示計算機的連接信息。該命令也控制永久網絡連接。 net use [devicename | *] [\computernamesharename[volume]] [password | *]] [/user:[domainname]username] [[/delete] | [/persistent:{yes | no}]] net use devicename [/home[password | *]] [/delete:{yes | no}] net use [/persistent:{yes | no}]

  • Net View

顯示域列表、計算機列表或指定計算機的共享資源列表。 net view [\computername | /domain[:domainname]]
net view /network:nw [\computername]
\computername
指定要查看其共享資源的計算機。 /domain[:domainname] 指定要查看其可用計算機的域。如果省略 domainname ,則顯示網絡的所有域。 /network:nw 顯示 NetWare 網絡中所有可用的服務器。如果指定計算機名,則顯示 NetWare 網絡中該計算機的可用資源。也可以用此開關指定添加到系統中的其他網絡。

原文地址:https://www.cnblogs.com/jizonghai/p/2880904.html