banner

[Rule] Rules  [Home] Main Forum  [Portal] Portal  
[Members] Member Listing  [Statistics] Statistics  [Search] Search  [Reading Room] Reading Room 
[Register] Register  
[Login] Loginhttp  | https  ]
 
Forum Index Thảo luận hệ điều hành Windows Command line cho Network Admin OS Microsoft  XML
  [Article]   Command line cho Network Admin OS Microsoft 24/06/2006 02:31:30 (+0700) | #1 | 746
thangdiablo
HVA Friend

Joined: 11/05/2003 17:31:58
Messages: 734
Offline
[Profile] [PM] [WWW]
Tạo User bằng Command Line ngồi từ máy user

connect bằng quyền admin và....


NET USER [username [password | *] [options]] [/DOMAIN]
username {password | *} /ADD [options] [/DOMAIN]
username [/DELETE] [/DOMAIN]

Ví dụ một trường hợp
NET USER THUNGHIEM /ADD sẽ add một user vào Group User với password rỗng.
NET USER TEST 123 /ADD sẽ add một user TEST với Password là 123 vào Group User hoặc Domain user.
Chú ý, nếu chỉ sử dụng trong môi trường Group thì chỉ có thể tạo được User ở máy Local.
Nếu dùng trong môi trường Domain, mọi chuyện lại dễ.
Ngoài ra, còn những Option khi tạo User (giống như động tác click chuột trên GUI)

Options Are as follows:

Options Description
--------------------------------------------------------------------
/ACTIVE:{YES | NO} Activates or deactivates the account. If
the account is not active, the user cannot
access the server. The default is YES.
/COMMENT:"text" Provides a descriptive comment about the
user's account (maximum of 48 characters).
Enclose the text in quotation marks.
/COUNTRYCODE:nnn Uses the operating system country code to
implement the specified language files for a
user's help and error messages. A value of
0 signifies the default country code.
/EXPIRES:{date | NEVER} Causes the account to expire if date is
set. NEVER sets no time limit on the
account. An expiration date is in the
form mm/dd/yy or dd/mm/yy, depending on the
country code. Months can be a number,
spelled out, or abbreviated with three
letters. Year can be two or four numbers.
Use slashes(/) (no spaces) to separate
parts of the date.
/FULLNAME:"name" Is a user's full name (rather than a
username). Enclose the name in quotation
marks.
/HOMEDIR:pathname Sets the path for the user's home directory.
The path must exist.
/PASSWORDCHG:{YES | NO} Specifies whether users can change their
own password. The default is YES.
/PASSWORDREQ:{YES | NO} Specifies whether a user account must have
a password. The default is YES.
/PROFILEPATH[:path] Sets a path for the user's logon profile.
/SCRIPTPATH:pathname Is the location of the user's logon
script.
/TIMES:{times | ALL} Is the logon hours. TIMES is expressed as
day[-day][,day[-day]],time[-time][,time
[-time]], limited to 1-hour increments.
Days can be spelled out or abbreviated.
Hours can be 12- or 24-hour notation. For
12-hour notation, use am, pm, a.m., or
p.m. ALL means a user can always log on,
and a blank value means a user can never
log on. Separate day and time entries with
a comma, and separate multiple day and time
entries with a semicolon.
/USERCOMMENT:"text" Lets an administrator add or change the User
Comment for the account.
/WORKSTATIONS:{computername[,...] | *}
Lists as many as eight computers from
which a user can log on to the network. If
/WORKSTATIONS has no list or if the list is *,
the user can log on from any computer.

Những Option trên chính là những phần Click chuột mà bạn thường hay sử dụng khi tạo trong Computer management, hoặc là dùng AD Computer and Users.

Ứng dụng tốt nhất của việc dùng Command line là: Bạn có thể tạo ra cùng một lúc nhiều User có chức năng tương tự nhau, bạn chỉ mất khoảng thời gian Edit và Test command đầu tiên, sau đó chỉ việc Copy và chỉnh sửa chút xíu, là có thể tạo thành một Teplate hoàn chỉnh rồi.
Good luck!
Hãy sống có Tuệ Giác.
[Up] [Print Copy]
  [Article]   Command line cho Network Admin OS Microsoft (Phần 2) 24/06/2006 02:33:45 (+0700) | #2 | 747
thangdiablo
HVA Friend

Joined: 11/05/2003 17:31:58
Messages: 734
Offline
[Profile] [PM] [WWW]
Cấu Hình IP bằng command line

Để cấu hình địa chỉ IP, DNS, WIN bằng command line.
Các bạn thực hiện các bước sau:
Vào của sổ command prompt.
gõ lệnh:
netsh <Enter>
interface IP <Enter>

<--Set IP Address-->
set address name= "Local Area Connection" source=dhcp <Enter>
set address local static <IP Address> <IP Supnet Mask <Enter>
vidu:
set address name= "Local Area Connection" source=dhcp <Enter>
set address local static 192.168.1.2 255.255.255.0 <Enter>

<--Set Preferred DNS Server -->
set dns name= "Local Area Connection" source=dhcp <Enter>
set DNS Local Area Connection" static <IP Address DNS> <Enter>

vidu:
set dns name= "Local Area Connection" source=dhcp <Enter>
set DNS "Local Area Connection" static 192.168.1.1 <Enter>

<--Set WINS address-->

set wins name= "Local Area Connection" source=dhcp <Enter>
set wins Local Area Connection" static <IP Address WINS> <Enter>

vidu:
set wins name= "Local Area Connection" source=dhcp <Enter>
set wins "Local Area Connection" static 192.168.1.1 <Enter>

<--De thoat khoi chuong trinh--->

Exit <Enter>

ShutDown một máy tính trong môi trường mạng từ xa(chỉ xải công cụ trong Windows) thì đòi hỏi một số yêu cầu sau :
1. Về công cụ để thực hiện : - Terminal Service
- hoặc NetMeeting application
- Computer Management
- Windows Command : SHUTDOWN trong bộ Resource Kit
2. Yêu cầu về quyền hạn của người dùng :
Tốt hơn hết, bạn có quyền Administrator trong môi trường mạng. Ví dụ: thuộc nhóm Administrators hoặc Domain Admin. Chú ý : một máy đã tham gia môi trường domain thì bao giờ bạn cũng có thể shutdown nó cho dù bạn không có username và password của Administrators locally.
HƯỚNG DẪN THỰC HÀNH : Sử dụng COMPUTER MANAGEMENT
Yêu cầu : Cần thiết lập môi trường domain để thấy được sự tối ưu khi triển khai quản trị hệ thống mạng. Giả sử trong mạng có các máy: PC1, PC2 tham gia môi trường domain MCP.COM và máy DOMAIN CONTROLLER DC1
Các bước cụ thể :
1. Logon ở máy PC1 bằng tàu khoản thangdiablo@mcp.com(thuộc nhóm Domain Users). Chú ý tài khoản này không có quyền hạn gì cả. Nhưng chúng ta sẽ sử dụng RUNAS với tài khoản là administrator@mcp.com để làm thao tác shutdown máy PC2
2. Vào RUN gõ : runas /user:administrator@mcp.com "mmc %systemroot%/system32/compmgmt.msc"
SAU ĐÓ : gõ password của administartor@mcp.com
3. Ở Computer Management[với quyền administrator@mcp.com], Chọn mục : CONNECT TO ANOTHER COMPUTER, gõ IP của PC2 hoặc tên máy là PC2.
Chọn PROPERTIES | tab Advanced| tab STARTUP and RECOVERY | tab SHUTDOWN và .... SHUTDOWN máy PC2.
4. Hết rồi
Chúc các bạn thử thành công.
PS : Chú ý là vừa sử dụng RUNAS vừa SHUTDOWN từ xa.

Nói về commandline, tui xin góp 1 lệnh nhé
-----------------------------------------------------------------------------------------
C:\>nslookup
Default Server: hcm-server1.vnn.vn
Address: 203.162.4.1
Aliases: 1.4.162.203.in-addr.arpa
Cho bieát DNS server mà client gởi query lên ở đâu !!?

C:\>nslookup ?
Usage:
nslookup [-opt ...] # interactive mode using default server
nslookup [-opt ...] - server # interactive mode using 'server'
nslookup [-opt ...] host # just look up 'host' using default server
nslookup [-opt ...] host server # just look up 'host' using 'server'

C:\>nslookup www.yahoo.com
Server: hcm-server1.vnn.vn
Address: 203.162.4.1
Aliases: 1.4.162.203.in-addr.arpa

Non-authoritative answer:
Name: www.yahoo.akadns.net
Addresses: 66.94.230.35, 66.94.230.32, 66.94.230.41, 66.94.230.46
66.94.230.39, 66.94.230.38, 66.94.230.42, 66.94.230.45
Aliases: www.yahoo.com
Query www.yahoo.com record từ client đến server


Tìm kiếm các record MX, NS, A, SOA, CNAME, . . . của một server bằng NSLOOKUP

C:\>nslookup
Default Server: hcm-server1.vnn.vn
Address: 203.162.4.1
Aliases: 1.4.162.203.in-addr.arpa

> set type=MX
> yahoo.com
Server: hcm-server1.vnn.vn
Address: 203.162.4.1
Aliases: 1.4.162.203.in-addr.arpa

Non-authoritative answer:
yahoo.com.vn-study.com MX preference = 10, mail exchanger = mail.vn-study.com

vn-study.com nameserver = dns1.name-services.com
vn-study.com nameserver = dns2.name-services.com
vn-study.com nameserver = dns3.name-services.com
vn-study.com nameserver = dns4.name-services.com
vn-study.com nameserver = dns5.name-services.com
mail.vn-study.com internet address = 203.162.2.17
dns1.name-services.com internet address = 63.251.163.102
dns2.name-services.com internet address = 216.52.184.230
dns3.name-services.com internet address = 63.251.83.36
dns4.name-services.com internet address = 64.74.96.242
dns5.name-services.com internet address = 212.118.243.99
dns5.name-services.com internet address = 212.118.243.100
dns5.name-services.com internet address = 212.118.243.101
Query MX record : danh saùch mail server

> set type=A
> yahoo.com
Server: hcm-server1.vnn.vn
Address: 203.162.4.1
Aliases: 1.4.162.203.in-addr.arpa

Non-authoritative answer:
Name: yahoo.com
Address: 66.218.71.198
Query A record(Host) cuûa moät server

> set type=SOA
> yahoo.com
Server: hcm-server1.vnn.vn
Address: 203.162.4.1
Aliases: 1.4.162.203.in-addr.arpa

DNS request timed out.
timeout was 2 seconds.
Non-authoritative answer:
yahoo.com
primary name server = hidden-master.yahoo.com
responsible mail addr = hostmaster.yahoo-inc.com
serial = 2004021604
refresh = 900 (15 mins)
retry = 300 (5 mins)
expire = 604800 (7 days)
default TTL = 600 (10 mins)

yahoo.com nameserver = ns1.yahoo.com
yahoo.com nameserver = ns2.yahoo.com
yahoo.com nameserver = ns3.yahoo.com
yahoo.com nameserver = ns4.yahoo.com
yahoo.com nameserver = ns5.yahoo.com
ns1.yahoo.com internet address = 66.218.71.63
ns2.yahoo.com internet address = 66.163.169.170
ns3.yahoo.com internet address = 217.12.4.104
ns4.yahoo.com internet address = 63.250.206.138
ns5.yahoo.com internet address = 216.109.116.17
>
Query SOA record, coù ñöôïc nhöõng thoâng soá replication cuûa server yahoo.com

C:\>nslookup
Default Server: hcm-server1.vnn.vn
Address: 203.162.4.1
Aliases: 1.4.162.203.in-addr.arpa

> server www.yahoo.com
Default Server: www.yahoo.akadns.net
Addresses: 66.94.230.42, 66.94.230.44, 66.94.230.34, 66.94.230.41
66.94.230.33, 66.94.230.36, 66.94.230.43, 66.94.230.39
Aliases: www.yahoo.com
>


C:\>nslookup

>ls [-a, d, t type ] domain [>filename]
---------------------------------------------------------------------
Hãy sống có Tuệ Giác.
[Up] [Print Copy]
  [Article]   Command line cho Network Admin OS Microsoft (Phần 3) 24/06/2006 02:34:27 (+0700) | #3 | 748
thangdiablo
HVA Friend

Joined: 11/05/2003 17:31:58
Messages: 734
Offline
[Profile] [PM] [WWW]
Còn nữa nè: Các lệnh truy cập vào admin tools:
-------------------------------------------------------------
AD Domains & Trusts domain.msc
AD Sites & Services dssites.msc
AD Schema Manager schmmgmt.msc
AD Users & Computer dsa.msc
Backup backup
Certification Authority certsrv.msc
Component Services comexp.msc
Computer Management compmgmt.msc
DHCP dhcpmgmt.msc
Distributed File System dfsgui.msc
DNS dnsmgmt.msc
Domain Controller Security Policy dcpol.msc
Domain Security Policy dompol.msc
Event Viewer eventvwr
Indexing Service ciadv.msc
Internet Authentication Service ias.msc
Internet Service Manager iis.msc
Local Security Policy secpol.msc
Network Monitor netmon
Routing & Remote Access rasmgmt.msc
Task Manager taskmgr
Telnet Server Administration tlntadmn
Terminal Service Manager tsadmin
Terminal Service Client mstsc

Hãy sống có Tuệ Giác.
[Up] [Print Copy]
  [Question]   Command line cho Network Admin OS Microsoft 24/06/2006 02:47:16 (+0700) | #4 | 751
[Avatar]
gamma95
Researcher

Joined: 20/05/2003 07:15:41
Messages: 1377
Location: aaa&quot;&gt;
Offline
[Profile] [PM] [ICQ]
bổ sung cho command net user
reset password current user ko cần bit pass cũ
net user %username% newpass
Cánh chym không mỏi
lol
[Up] [Print Copy]
[digg] [delicious] [google] [yahoo] [technorati] [reddit] [stumbleupon]
Go to: 
 Users currently in here 
1 Anonymous

Powered by JForum - Extended by HVAOnline
 hvaonline.net  |  hvaforum.net  |  hvazone.net  |  hvanews.net  |  vnhacker.org
1999 - 2013 © v2012|0504|218|