How can I create a report of all the users and groups in my domain?
=====================================================
Note: Removal of the /domain switch will generate a report for the local machine.
NET USERS /DOMAIN >USERS.TXT
This command will return the user accounts from the Primary Domain Controller (PDC) of the current domain, and write them to a file called USER.TXT
NET ACCOUNTS /DOMAIN >ACCOUNTS.TXT
This command will return the account policy information from the PDC of the current domain, and write it to a file called ACCOUNTS.TXT
NET CONFIG SERVER >SERVER.TXT
This command will return the server name, version of Windows, active network adapter information/MAC address, Server hidden status, Maximum Logged On Users, Maximum open files per session, Idle session time, and assign it to a file called SERVER.TXT
NET CONFIG WORKSTATION >WKST.TXT
This command will return the workstation name, user name, version of Windows, network adapter, network adapter information/MAC address, Logon domain, COM Open Timeout, COM Send Count, COM Send Timout, and write it to a file called WKST.TXT.
NET GROUP /DOMAIN >DGRP.TXT
This command will return the global groups on the PDC of the current domain, and write them to a file called GRP.TXT.
NET LOCALGROUP >LGRP.TXT
This command will return the local groups on the local machine, and write them to a file call LGRP.TXT.
NET VIEW /DOMAIN:DOMAINNAME >VIEW.TXT
This command will return the resources in the specified domain, and write them to a file called VIEW.TXT.
Method #1: By using the NET USER command
====================================
NET USER is an old NT-related user manipulation command. I will not list all of it’s attributes here
(you can find for yourself by going to the Help and Support site on your computer). I do not usually use the
NET USER command in an AD environment, mostly due to the fact that it is not tailored for AD objects at all, but still, it can be used for our needs.
You can use the FOR and NET USER commands to accomplish the task in a “quick and dirty” way, without scripting or writing any code.
For example, if you type from the command prompt:
———
FOR /L %i in (1,1,500) DO NET USER MyUser%i /ADD
———
This will result in creating 500 new users, named MyUser1, MyUser2, etc. You can, of course, customize the FOR command’s parameters. See the FOR command help for more options.
You can also set the user’s password (in this case – P@ssw0rd) in the same manner:
FOR /L %i in (1,1,500) DO NET USER MyUser%i P@ssw0rd /ADD
You can delete all those users by running the following command:
FOR /L %i in (1,1,500) DO NET USER MyUser%i /DELETE
Note: If run on a stand alone W2K Server, W2K PRO or on an XP machine, this script will create local users. If run on a DC it will create users in the USERS Container in the AD. However, doing so on a domain controller will not create fully AD-compatible users (as you can clearly see if you open one of these users and try to find the User Principal Name – UPN – field).
Note: If you’re using a W2K PRO or XP PRO computer that is connected to an Active Directory network and you wish to create local users on that computer – run the command above. However, if you want, from that computer, to create users in the Active Directory database on the DC, use this command instead:
FOR /L %i in (1,1,500) DO NET USER MyUser%i P@ssw0rd /domain /ADD
To create users with pre-configured names (for example – a file with all your company’s usernames or a database with usernames) create a text file like this one:
daniel moshe yossy gabi ran bijo baruch bibi
Name the file USERS.TXT and place it in a directory.
Now open a CMD in that directory and run the following command:
FOR /F %i in (users.txt) DO NET USER %i P@ssw0rd /domain /ADD
This will create user accounts with the names found in the USERS.TXT file, all with the same password – P@ssw0rd. You don’t have to use the /domain switch unless you want to.
See the NET USER or NET USERS command help for more options.
Method #2: By using the NET command DOS
====================================
command line atau dos pada os windows,merupakan aplikasi yang sangat unik dan menarik.
kita dapat melakukan berbagai perintah dalam os dengan mengetikan perintah pada command line ini:
salah satu perintah yang dapat di akses lewat command line adalah perintah untuk configurasi
network/jaringan anda.
net.jpg
berikut adalah perintah dasarnya :
c:\net [opsi tambahan]
opsi-opsi yang tersedia :
accounts >> untuk mengatur account network, berikut yang dapat dikonfigurasi dalam opsi ini:
sytanx : c:\net accounts opsi : nilai/variabel
** force user log off how long after time expires
** minimum passoword age (days)
** maximum passowrd age (days)
** minimum password length
** length of password history maintained
** lockout threshold
** lockout duration (minute)
** lockout observation window (minute)
** computer role :
computer >> untuk menambah atau menghapus komputer dalam network
syntax : c:\net computer \\client01 /add
berikut adalah nilai yang dapat diubah dalam perintah ini :
** server name
** server comment
**
config >> berfungsi untuk mengatur konfigurasi server atau workstation
syntax : c:\net config server
berikut adalah configurasi dalam perintah config :
** server
** workstation
continue >> perintah ini untuk melanjutkan service yang berjalan.
syntax : c:\net continue service
file >> perintah ini untuk manajemen file sharing dalam network
syntax : c:\net file
group >> perintah untuk pengaturan group computer dan domain lewat WDC (windows domain controler)
sntax : c:\net group
help >> perintah ini untuk menampilkan menu help pada setiap opsi perintah net
syntax : c:\net help [opsi]
helpmsg >> perintah ini untuk menampilkan bantuan pada setiap nomer pesan error yang muncul
syntax : c:\net helpmsg [no.pesan,contoh 2185]
localgroup >> perintah untuk konfigurasi localgroup dalam network
syntax : c:\net localgroup [opsi]
berikut opsi yang tersedia dalam localgroup:
** administrators
** backup operators
** guests
** help service groups
** network configuration operators
** power users
** remote desktop users
** replicator
** users
name >> perintah untuk mengatur name alias yang bekerja pada messenger,
syntax : c:\net name
pause >> perintah untuk mempause suatu service atau resource yang berjalan dalam network.
syntax : c:\net pause service [nama service]
contoh nama service yang berjalan :
** net logon
** nt lm security support provider
** shedule
** server
** workstation
print >> perintah untuk menampilkan pekerjaan yang berjalan dalam komputer jaringan.
sytanx : c:\net print \\client01
opsi yang dapat dilakukan dalam perintah print adalah :
** \\computername : the name of the computer sharing the printer queue(s)
** sharename : name of the shared printer queue.
** job# : identification number assgined to a print.
** hold : prevents a job in a queue from printing.
** /release : reactivates a job that is held
** /delete : removes a job from a queue
send >> perintah untuk mengirimkan pesan pada user atau komputer lain dalam network.
syntax : c:\net send {nama : * : /domain[name] : /users } pesan
session >> perintah untuk menampilkan data sesi tiap2 komputer dalam network.
syntax : c:\net session \\client01 /delete
opsi dalam sesi ini adalah :
** \\namakomputer : nama komputer yang akan di cetak sesinya dalam network.
** /delelte : sesi terakhir yang terjadi dalam network.
share >> perintah ini berfungsi untuk menshare resource yang ada pada server agar dapat digunakan
dalam network.
syntax : c:\net share [sharename]
opsi yang tersedia dalam perintah net share :
** sharename
** drive:path
** /users:number
** /unlimited
** /remark:”teks”
** devicename
** /delete
** /cache:manual
** /cache:documents
** /cache:programs
** /cache:none
start >> perintah ini berfungsi untuk menampilkan dan menjalankan service pada server.
sytanx : c:\net start “service”
berikut adalah daftar bebearapa service yang dapat dilihat pada net start:
** application layer gateway service
** automatic updates
** COM+ event system
** computer browser
** cryptographic services
** DHCP client
** Distributed Link Tracking Client
** DNS client
** Error reporting Services
** Event log
** Help and support
** IIS admin
** Internet Connection Firewall (ICF) / Internet Connection Sharing (ICS)
** IPSEC Services
** Logical Disk manager
** Mysql
** Network Connections
** Network Location Awareness (NLA)
** Remote Procedure Call (RPC)
** Simple Mail Transfer Protocol (SMTP)
** Security Accounts Manager
** TCP/IP netBios Helper
** Telephony
** Webclient
** Wireless zero configuration
** World Wide Publishing
statistics >> perintah ini untuk menampilkan log statistic pada jaringan lokal atau service server.
syntax : c:\net statistics [opsi]
berikut adalah opsi yang tersedia pada net statistics :
** server : menampilkan log statistic server
** workstation : menampilkan log statistic workstation
stop >> perintah ini berfungsi untuk menghentikan service yang berjalan dalam network.
syntax : c:\net stop [service]
berikut daftar beberapa service yang dapat distop dengan perintah net stop :
** alerter
** browser
** client service for netware
** clipbook
** DHCP client
** file replication
** messenger
** net logon
** NT LM security support provider
** remote accsess connection manager
** routing and remote access
** RPCLOCATOR
** Schedule
** server
** spooler
** TCP/IP NetBios helper service
** UPS
** workstation
time >> perintah ini berfungsi untuk mencocokan jam di komputer dengan komputer lain atau domain.
atau juga untuk menampilkan waktu pada komputer lain atau domain.
syntax : c:\net time [opsi]
berikut beberapa opsi yang ada pada net time :
** \\computername
** /domain:namadomain
** /RTSdomain:namadomain RTS=Reliable Time Server
** /set
** /querysntp
** /setsntp:ntp server list
use >> perintah ini berfungsi untuk menghubungkan atau memutuskan sebuah komputer ke sebuah resources yang
dishare dalam network
syntax : C:\net use [opsi]
beberapa opsi dalam perintah net use :
** devicename
** \\computername
** \sharename
** \volume
** password
** /user
** domainname
** username
** /smartcard
** /savecred
** /home
** /delete
** /persistent
** yes
** no
user >> perintah ini befungsi untuk membuat,mengubah,ataupun menghapus user dalam suatu workstation.
syntax : c:\net user [username[passowrd:*][option]] [/domain]
view >> perintah ini berfungsi untuk menampilkan daftar resource yang dishare dalam network.
syntax : c:\net view \\namakomputer /cache : /domain:namadomain
ket opsi cache : display the offline caching settings for the resources the specified computer.
by : Cah Surip
at 14 Dec 08, 1:58 pm
