Jumat, 27 April 2012

Create a report of all the users and groups in you domain server.


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 policy account 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 timeout, 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 specified resources in the 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 command Following:

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-compatible AD users (as you can see Cleary 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 is connected to the computer That 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 / domains / 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 Yossy Gabi Moshe's aunt ran bijo baruch

Name the file and place it USERS.TXT in a directory.

Now open a CMD in That directory and run the command Following:

FOR / F% i in (users.txt) DO NET USER% i P @ ssw0rd / domains / ADD

This will create user accounts with the names found in the USERS.TXT file, all with the same password - P @ ssw0rd. You do not have to use the / domain switch unless you want to.

See the NET USER NET USERS command or help for more options.

Please do not use this information for illegal uses.
If you have used this information to make use of this information for goodall kinds of information contained in the article is an adaptation of resource sharing.
Disclaimer
What im hoping by releasing this information is that it will help down on distributed copyrighted information.

Tidak ada komentar:

Posting Komentar