View user account details
NET USER [/DOMAIN]
Add a user account.
NET USER username {password | *} /ADD [options] [/DOMAIN]
Modify a user account.
NET USER [username [password | *] [options]] [/DOMAIN]
Delete a username
NET USER username [/DELETE] [/DOMAIN]
Generate a random password:
NET USER administrator /random
Add a Workgroup
NET GROUP groupname /ADD [/COMMENT:”text”] [/DOMAIN]
Edit a workgroup
NET GROUP [groupname [/COMMENT:”text”]] [/DOMAIN]
Delete a group
NET GROUP groupname /DELETE [/DOMAIN]
Add a user to a group
NET GROUP groupname username […] /ADD [/DOMAIN]
Delete a user from a group
NET GROUP groupname username […] /DELETE [/DOMAIN]
Examples
Create a group
C:>NET LOCALGROUP spud /add
Add to guests
C:>NET LOCALGROUP guests spud /add
Then remove
C:>NET LOCALGROUP guests spud /delete
C:>NET LOCALGROUP spud /delete
– Net use command
– Net share command
Net use command
net use [drive]: [“UNC path, eg: \servershare”] [password] /user:[domainusername]
Net share command
NET SHARE sharename = drive:path /users: number | /unlimited /remark: “text”
NET SHARE
sharename
sharename=drive:path [/GRANT:user,[READ | CHANGE | FULL]]
[/USERS:number | /UNLIMITED] 設置可同時訪問共享資源的最大用戶數
[/REMARK:”text”]
[/CACHE:Manual | Documents| Programs | BranchCache | None]
sharename [/USERS:number | /UNLIMITED]
[/REMARK:”text”]
[/CACHE:Manual | Documents | Programs | BranchCache | None]
{sharename | devicename | drive:path} /DELETE
sharename \computername /DELETE
ShareName
Specifies the name of the shared resource as it should display on the network.
Drive:Path
Defines the absolute path of the directory to be shared.
/remark:“Text“
Adds a description about the resource. Do not forget to enclose it in quotation marks.
/users:Number
Used to set the maximum number of users who can simultaneously access the shared resource.
/unlimited
This setting specifies an unlimited number of users who can simultaneously access the shared resource.
/cache:manual
Enables offline client caching with manual reintegration.
/cache:automatic
Enables offline client caching with automatic reintegration.
/cache:documents
Enables automatic caching of documents from this share.
/cache:programs
Enables automatic caching of documents and programs.
/cache:no
Disables caching.
/delete
Stops sharing the shared resource.
other net commands
NET GROUP | Add a Workgroup NET GROUP [GROUP_NAME] /ADD [/COMMENT:”TEXT”] [/DOMAIN] Edit a workgroup Delete a group Add a user to a group Delete a user from a group To View, Add or modify a local workgroup replace GROUP in the commands above with LOCALGROUP. |
||||||||||
NET HELP | Displays information about NET commands and error messages.
COMMAND /?
|
||||||||||
NET LOCALGROUP | NET LOCALGROUP [GROUP_NAME [/COMMENT:”TEXT”]] [/DOMAIN]
NET LOCALGROUP [GROUP_NAME /ADD [/COMMENT:”TEXT”]] | /DELETE} [/DOMAIN] NET LOCALGROUP [GROUP_NAME ] [NAME] […] {/ADD | /DELETE} [/DOMAIN] |
||||||||||
NET PASSWORD | Changes your logon password.
NET PASSWORD [OLD_PASS [NEW_PASS]] For changing the password for your password-list file. password on a Windows NT or LAN Manager server or domain.
|