In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
Sometimes we need to get the information and status of the users in the AD domain, want to know which user accounts are disabled, which user accounts are normal, the user's department, phone, position information, and so on.
Now I would like to share the experimental steps I have done.
Step 1: first, use script commands to export AD user information, and you can export useful user information and filter out unwanted information according to your own needs.
Command script:
Csvde-d "ou=XX Company, DC=contoso,DC=com"-r "(& (objectcategory=person) (objectClass=user))"-l "name,sAMAccountName,description,title,department,telephoneNumber,mail,userAccountControl"-f C:\ Users\ Administrator\ Desktop\ Users-List.csv-s contoso.com-u
The script explains:
-d "ou=users,ou=XX Company, DC=XXXX,DC=Com" ou is the organizational structure, and the representative of ou=users,ou=XX Company means the users organization under the organization of XX Company, which is a hierarchical representation, from low to high in the command line corresponding from left to right. DC is a domain name, which is also a hierarchical structure. DC=XXXX,DC=Com means the XXXX under Com, that is, the domain name XXXX.com. For example, abc.XXX.com corresponds to DC=abc,DC=XXXX,DC=Com.
-r "(& (objectcategory=person) (objectClass=user))" is to filter the data to be exported, (objectClass=user) is to define large categories and only guide user information, but the user of AD also includes computer and other information in addition to user information, so use (objectcategory=person) to filter, so that there is only user information. If omitted here, all AD information will be exported is quite messy.
-l "name,userPrincipalName" is a specific field that needs to export user information. Here are the name and login name, respectively. For other fields, please see the image below.
-f C:\ Users\ Administrator\ Desktop\ Users-List.csv refers to the path to the exported file, but the user's Chinese information will be displayed in a 16 mechanism code, so add a-u after it, but this also has its drawbacks. The exported data is mixed in a column after adding-u, and the imported text of excel can be used to separate the functions by commas.
-the server to which the s servername is bound (default is the DC of the computer domain)
On the DC server, run cmd, enter the script command, run to get a csv file, and then separate the functions with the comma of Excel to get the following information
Here is only the part I want to export, if you need to export other information, please refer to the last few pictures of this article: "user information parameter name comparison picture"
Step 2: organize the form. In the DN column, there is the user's name and the organization to which he belongs, which is ugly, so we use the Excel function to display it as the effect we want.
After column A, insert 3 columns and enter the function in column B2
= TRIM (SUBSTITUTE (MID (SUBSTITUTE ($A2, "=", REPT (", 999)), COLUMN (A2) * 999999),", ", REPT (", 999))
Then drag the column horizontally to C2PowerD2, then pull it down longitudinally, and finally display all the departments behind the OU. As shown in the following figure:
If you change the title of the first row, the table will look good.
Add the parameter userAccountControl, which indicates the status of the account. For its value, please refer to the following figure:
The following picture is "user information parameter name comparison picture"
Write down this log here for your reference, experience sharing and information sharing.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.