WEBVTT

00:00.450 --> 00:05.880
So far we've seen how to create a single user account and Active Directory.

00:06.030 --> 00:13.410
Now let's explore how to create multiple user accounts in one go the following command is sufficient

00:13.410 --> 00:19.370
enough if you want to create Baalke user objects in the lap environment result.

00:19.430 --> 00:25.440
Vaurien about other properties such as Department email and so on.

00:25.440 --> 00:32.600
So let's review this command and this command to create in 102 users.

00:32.640 --> 00:40.650
Of course you can create more or less users like you can grade from 1 to 20 of from one to solve them

00:40.650 --> 00:47.920
to users and for each user we are given a name like user and the number.

00:48.060 --> 00:55.080
So the users will be created like Lerp user or one level user or two and so on the password for each

00:55.080 --> 01:04.150
user will be equal to this variable which we've provided before and the users will be created in lap

01:04.290 --> 01:05.170
over you.

01:05.310 --> 01:12.260
So let's run this command and start to check it in Active Directory administrative center.

01:12.390 --> 01:19.940
The command to complete it and we can go to Active Directory administrative settings service center

01:20.250 --> 01:24.620
and check the newly created users in a lab.

01:24.660 --> 01:31.210
Oh you as you can see it is populated now with the newly created users.

01:31.350 --> 01:40.410
So it's a simple foreach loop that runs 100 times or whatever number of times you'll need to create

01:40.410 --> 01:47.420
a user account with a name lab user and suffixed by the number of iterations sodgers.

01:47.550 --> 01:55.590
As I've said lab user wanted lab user to and so on with their passwords cert to the value of the past

01:55.590 --> 01:56.710
for 12 MBO.

01:56.820 --> 02:02.160
However this is not sufficient to create accounts in production environment.

02:02.220 --> 02:10.740
We need to populate several attributes at the time of creation ideally system administrators receive

02:10.740 --> 02:17.040
their account creation information from H.R. department and some other department.

02:17.040 --> 02:27.990
And ideally they receive it in CXXVI format and we can have a is file which will be read by Power Shell

02:28.050 --> 02:36.570
and Treach you'll have the details of user attributes and create user accounts based on this information.

02:36.690 --> 02:44.720
So to read this CSP file from a power shell variable we have a special command lead for it.

02:44.750 --> 02:48.680
Come on let called import does this.

02:48.900 --> 02:56.810
And it can read the contents of the file and return the output in object format.

02:56.850 --> 03:01.880
We can make use of it to read the contents with the following command.

03:02.010 --> 03:10.450
Let's create a variable which we'll call users and fields will be equal to import dustiest fee.

03:10.620 --> 03:21.020
And we have to specify the pass to the saved CC file then will read this variable and output it in a

03:21.020 --> 03:29.950
format table view so it will show the contents of the variable in table format just for testing purposes.

03:29.970 --> 03:36.240
I have downloaded such a file in cells format from Microsoft Web site.

03:36.390 --> 03:45.020
You can create such a file by yourself or also download it from Microsoft's Web site.

03:45.330 --> 03:49.740
Now they have all user details in this fire file.

03:49.740 --> 03:58.740
So that's Brucey to create user accounts from this file and we'll do that with the following command.

03:58.740 --> 04:07.120
First real important to this file is the password but then we'll read this file with foreach command.

04:07.140 --> 04:13.680
And for each user in this file we'll add the following properties.

04:13.740 --> 04:19.130
Display Name given name Name Surname account name.

04:19.200 --> 04:24.060
They count will be enabled and parsed for never expires.

04:24.060 --> 04:33.730
For this account also will give you the principal name property account password Mildrid from the variable

04:33.730 --> 04:41.130
which we've added before and the past to this account will be like let your past could be different.

04:41.130 --> 04:48.850
So make sure you specify the correct path to the owner you in your environment.

04:49.020 --> 04:56.250
In case you don't specify pass parameter it will put the account into the default.

04:56.340 --> 04:58.290
You user.

04:58.300 --> 05:05.890
So you anti-elite will perform that response through parameter which will show the results of the command.

05:05.890 --> 05:14.340
Now let me open the file I've created from which will populate this parameterless as you can see we've

05:14.410 --> 05:18.050
got all this information in this file.

05:18.100 --> 05:24.610
And as you can imagine we can add and populate the information we need.

05:24.640 --> 05:32.270
For example if we need to add e-mail we can do this by typing an e-mail here.

05:32.410 --> 05:39.190
And we also have to type e-mail in each of the lines of this file.

05:39.310 --> 05:51.160
For example for John Doe account we'll have Jadot at contorts dot com for Chris Greene account.

05:51.170 --> 05:57.050
We'll have see green at contorts dot com.

05:57.050 --> 06:01.240
We could also add a telephone number for this.

06:01.240 --> 06:11.660
We add phone parameter on that our power line and we add the telephone for each account like this.

06:11.680 --> 06:23.130
I left a telephone for John Doe 1 2 3 11 11 and to telephone for Chris Green 1 2 3 11 12.

06:23.290 --> 06:33.940
And of course we have to address parameters in our script so we'll add the line here like e-mail address

06:34.270 --> 06:40.500
which will be equal to variable user and e-mail.

06:40.540 --> 06:51.940
We also have to add phone number this parameter office phone and it will be equal to the variable dollars

06:52.330 --> 07:01.880
sign user that phone and it will populate the new users with the needed parameters.
