WEBVTT

00:05.970 --> 00:13.480
One working on large or complex environments performing bulk operations is the key to efficiency use

00:13.480 --> 00:20.710
and power schelde core common glass such as gut content which you have already mentioned and importances

00:20.760 --> 00:21.480
feet.

00:21.630 --> 00:29.850
We can easily import external data into the shell and to use this information to perform Baul corporations

00:29.910 --> 00:34.730
on hundreds or thousands of objects in a matter of seconds.

00:34.890 --> 00:43.880
Obviously we can want to speed up the time spent on routine tasks and greatly increase our efficiency.

00:44.070 --> 00:52.590
And this video will use these concepts to add members to distribution groups in bulk from a text or

00:52.820 --> 01:02.130
a file using the Exchange management shell to start off let's create a text file called users dot text

01:02.180 --> 01:06.240
me I'll create it on a C drive root.

01:06.330 --> 01:13.140
This file will list the recipients in your organization that you want to add to a group.

01:13.200 --> 01:17.160
Make sure you answer them one line at a time.

01:17.160 --> 01:24.390
Next up we have to run the following code to add the list of recipients to a distribution group real

01:24.410 --> 01:24.800
time.

01:24.810 --> 01:26.170
Get content.

01:26.190 --> 01:28.400
The path to our file.

01:28.470 --> 01:30.980
In my case it's siecle backslash.

01:31.120 --> 01:40.500
Users don't text and pipe the results to for each object command left and as a result each object which

01:40.500 --> 01:50.490
is contained in our file will be added to sales distribution group with the ADD distribution group member

01:50.490 --> 01:51.490
command left.

01:51.630 --> 01:59.640
When the code runs each user loose to tell the users that txt file will be added to the sales distribution

01:59.640 --> 02:06.870
group when important data from a plain text file we use to get content command left which will read

02:06.870 --> 02:11.520
the content of the file into the shell one line at a time.

02:11.520 --> 02:18.750
In this example we pipe the content of the file to the foreach object command left and as each line

02:18.750 --> 02:27.690
is processed we run the ADD distribution group command let inside the foreach object script block.

02:27.800 --> 02:35.970
We're there at distribution group member command left and to sign the dollar sign on the bar or object

02:36.150 --> 02:42.100
which is the current recipient item in the pipeline to the member parameter.

02:42.240 --> 02:49.170
Please know that to remove recipients from a distribution group you can use the remove distribution

02:49.170 --> 02:50.880
group member command lead.

02:50.970 --> 02:58.500
Now keep in mind that this text file does not have to contain the S.M. to be address of the recipient.

02:58.500 --> 03:06.780
You can also use the active directory called Name use or principal name distinguished name Greta or

03:07.020 --> 03:08.790
legacy change.

03:08.810 --> 03:13.910
DN Well here's the important thing that the file contains.

03:13.920 --> 03:17.520
Well it and to unique Well your foreach recipient.

03:17.660 --> 03:25.810
If the identity of the recipient cannot be determined the distribution group member command will fail.

03:25.950 --> 03:34.740
In addition to use an plain text files we can also import recipients from a CSP file and add them to

03:34.740 --> 03:36.300
a distribution group.

03:36.420 --> 03:44.910
Let's say that you have a CSP file set up with multiple columns such as first name last name and email

03:44.910 --> 03:45.620
address.

03:45.720 --> 03:52.580
When you import this history file the data can be accessed using the goal and headers of the property

03:52.660 --> 03:54.290
names for each object.

03:54.330 --> 03:58.860
In this case we have to use imports since the command left.

03:58.860 --> 04:05.480
So when you do each item in the collection of an email address like in my file.

04:05.490 --> 04:12.450
Users don't see this field as long as this information corresponds to the recipient data in the exchange

04:12.450 --> 04:13.550
organization.

04:13.560 --> 04:21.360
We can simply loop through each record to see as we file and add this recipients to a distribution group.

04:21.360 --> 04:29.610
Take a look at this code we are using an import says siecle on backslash users Dud's seriously and pipe

04:29.610 --> 04:39.120
it to for each object we use add distribution group mamber we are adding each object to sales distribution

04:39.120 --> 04:45.990
group and sorting out all this information by email address calling.
