WEBVTT

00:05.960 --> 00:13.220
Once your database availability group has been created and configure the next step is to setup database

00:13.220 --> 00:21.290
replication by adding new mail bugs database copies of existing database and this video will take a

00:21.290 --> 00:25.380
look at how to add mailbox database copies.

00:25.440 --> 00:29.620
You then they exchange management show so how to do it.

00:29.720 --> 00:37.610
Use the ad mail bogus database copy command left to create a copy of an existing database.

00:37.640 --> 00:46.880
You could type at mail box database copy your database for example to be one mailbox server for example

00:47.070 --> 00:55.420
it changed one or in my case alone X1 and activation preference equal into two.

00:55.430 --> 01:03.980
So when running this command a copy of the one database is created on the exchange one server or exchange

01:03.980 --> 01:05.000
to server.

01:05.120 --> 01:14.740
You should replace this with your particular database and server to which you want to make a copy.

01:14.810 --> 01:22.310
When creating a copy of a database on another mailbox server unit to ensure that the server in the same

01:22.490 --> 01:28.490
dock as the mailbox server host in the source mailbox database.

01:28.490 --> 01:36.410
In addition a mailbox Sora can only hold one copy of a given database and the database pass must be

01:36.500 --> 01:39.850
identical on every server in the dog.

01:39.890 --> 01:45.860
So make sure that the disk boss exists on the server or your read and a copy too.

01:45.980 --> 01:53.630
Of course you can remove a database copy using the remove mailbox database copy command let please run

01:53.810 --> 02:02.480
get help remove mail box database copy full for details so when running the ad mailbox database copy

02:02.480 --> 02:09.950
come and let you need to specify the identity of the database and the destination mailbox server that

02:09.950 --> 02:12.200
will be hosting the database.

02:12.200 --> 02:20.210
Copy the activation reference for a database can optionally be set when you create the database copy

02:20.540 --> 02:28.940
the value of the activation preferences one of the criteria used by the two active manager during a

02:28.970 --> 02:35.940
fail over event to determine the best replicated database copied to activate.

02:35.990 --> 02:45.020
Now in order to create and mound data mailbox databases and add database corpus to multiple servers

02:45.020 --> 02:49.930
and a dog several commands must be run from within this shell.

02:49.970 --> 02:58.760
If you do deployments on a regular basis or if you build up and tier down lap environments frequently.

02:59.060 --> 03:03.700
This is a process that can easily be automated with power shell.

03:03.740 --> 03:05.510
The power shall function.

03:05.510 --> 03:15.380
New Dark Mail Box database creates new mail bugs databases from scratch mounts them and then adds passive

03:15.380 --> 03:19.670
copies of each database to the Romanian servers.

03:19.670 --> 03:24.050
You specify the code for this function is as follows.

03:24.050 --> 03:33.590
Lets type function new Dark Mail Box database parameter with set of variables active server passive

03:33.590 --> 03:43.930
sorrow database prefix database count EDI folder press log folder press and now let's use for loop and

03:44.120 --> 03:51.230
use an all these variables then we'll add mail box database copay for rich object.

03:51.230 --> 03:57.800
Once you've added this function to your shell session you can run it to use on the syntax similar to

03:57.800 --> 04:07.220
the following new dock mail box database active Server Exchange 1 passive Server Exchange 2 3 4 and

04:07.250 --> 04:20.990
so on database count 3 database prefix D.B. or MTBE UDP folder should be on drive e in database folder

04:21.050 --> 04:28.510
and log folders should be on drive fee in database folder as well you can specify the folders you wish

04:28.520 --> 04:35.990
here running this function with the given parameters will do a number of things first three new databases

04:36.290 --> 04:42.110
will be created using a prefix of DB Your MDA B for example.

04:42.110 --> 04:49.270
This function will create a database using the same prefix and then number of them in order.

04:49.310 --> 04:59.600
In this example the active Server Exchange 1 will have three new databases created called W1 W2 and

04:59.620 --> 05:00.680
W3.

05:00.830 --> 05:08.430
The passive server parameter needs to have one or more servers defined in this case you can see that

05:08.730 --> 05:17.900
we've added database corpus to the three new databases to each of the passive server specified all databases

05:17.910 --> 05:25.680
and log files on each server will be located in a folder under you drive database in a sub director

05:25.680 --> 05:33.270
that matches the database name in some environments you might find that trying to mount a database immediately

05:33.510 --> 05:36.470
after it was created will fail.

05:36.510 --> 05:42.300
What it boils down to is that the Mount operation is happening too quickly.

05:42.360 --> 05:51.030
If you run into this at a delay before the Mount operation by Iran and start slip down for example before

05:51.030 --> 05:57.070
calling the Mount database command let this will pause the script for 10 seconds.

05:57.070 --> 06:04.330
Given exchange time to catch up and realize that the database has been created before trying to mount

06:04.330 --> 06:13.930
it and this video will take a look at how to remove a database copy using the remove mail box database

06:13.940 --> 06:15.580
corporate command led.

06:15.590 --> 06:26.230
So first I've logged on to the e x 1 server with power shell Direct which is very useful and handed

06:26.240 --> 06:31.400
to available on Server 2016 and above.

06:31.400 --> 06:37.820
So I've typed and or P assertion or it's alias it is Sam.

06:38.030 --> 06:44.150
Then I can type the name of virtual machine to directly connect to this machine.

06:44.150 --> 06:52.130
So I've used a parameter the M name and the name of my exchange server which is x1.

06:52.130 --> 07:01.400
I've also used credentials parameter to specify my credentials which are control so backslash administrator

07:01.730 --> 07:11.590
enter my password and after that I could use the power shell session on X1 server.

07:11.750 --> 07:23.410
I then typed ADP sniping with the exchange in it to add all the snap pins connected or deal and with

07:23.440 --> 07:31.290
exchange power shell module so I could run the commands intended for exchange management.

07:31.430 --> 07:40.920
So first off let's check all the databases on on the exchange environment by type and get mailbox data

07:40.950 --> 07:41.960
database.

07:41.990 --> 07:49.910
As you can see we've got six database for now to be 1 to be 2 and 3 demo databases which we've created

07:50.180 --> 07:52.330
in previous video.

07:52.450 --> 08:02.480
Now we can use the get mail box database corpus status command led and we've got three mounted databases

08:02.540 --> 08:04.380
and two dismounted.

08:04.400 --> 08:15.860
So no let's remove a database copy for Demo 1 database by typing remove mailbox database copy and the

08:15.860 --> 08:17.470
name of the database.

08:17.540 --> 08:23.910
I'll use derma 1 slash e x 1 database copy name.

08:23.930 --> 08:29.300
This will remove the database but you have to remove the files.

08:29.300 --> 08:32.690
The physical files if you need to.

08:32.750 --> 08:39.160
So let's check the files on the X to server and delete them.

08:39.260 --> 08:45.710
With the help of power show for this I'll switch over to another power shall console.

08:45.770 --> 08:53.780
So let me open the console itself and log in to exchange 2 is entropy assertion come on loud so I'll

08:53.780 --> 08:55.000
type it here.

08:55.000 --> 09:04.100
Sam Dash the name X to dash credential control so administrator.

09:04.260 --> 09:06.510
I'll type in my password.

09:06.530 --> 09:15.560
Wait a second I'm on exchange 2 so I'll change the location to the root of C drive by type in city backslash

09:15.860 --> 09:25.570
and I can list the contents of C drive by type in a lessor dear amount or get child item whatever amount

09:25.640 --> 09:27.950
you prefer soil type or less.

09:28.220 --> 09:36.740
And here is a folder of my databases which is database so I'll change location to database folder by

09:36.740 --> 09:38.650
type in city database.

09:38.690 --> 09:40.510
Let's see what's in there.

09:40.580 --> 09:51.880
So the directory for Demo 1 database is demo 1 and it's here as you can see removed by database copy

09:51.910 --> 09:56.530
command just removed the object from active directory.

09:56.540 --> 10:05.570
But no let's remove for the files itself so I'll type our Ram by the way you can always find the aliases

10:05.570 --> 10:08.760
for different commands with get L.A. command.

10:08.780 --> 10:16.880
For example if you don't know the aliases for remove item you could find them by type and get alias

10:17.110 --> 10:25.850
SLAs definition and remove item and it'll reveal all that Ellis is for remove item command and as you

10:25.850 --> 10:28.340
can see a ram is one of them.

10:28.370 --> 10:32.600
So our Ram means to remove the item.

10:32.600 --> 10:35.410
In my case it's derma 1.

10:35.420 --> 10:44.950
Now let's switch over back to X1 server and take a look at some more examples by of you then get mail

10:44.950 --> 10:47.920
box database copy status command land.

10:47.990 --> 10:56.780
So I'm here around lets type get mailed back to the mail box database copy status demo 2 and it'll reveal

10:57.110 --> 11:02.450
the status for damage to the database like name.

11:02.480 --> 11:11.770
As you can see we've got demo to flashy X1 and are two bucks less shakes to the status for one is mounted

11:11.770 --> 11:14.740
and the status for re x2 is healthy.

11:14.740 --> 11:20.180
We've also got corporate Q lands and last inspected log time.

11:20.440 --> 11:27.330
But if what if we want to find out some more details about this database let's return this command can

11:27.350 --> 11:29.800
get mailbox database corporate status.

11:29.810 --> 11:38.820
Demo too and pipe it to select all and we'll got all we'll get all the details on this database.

11:38.830 --> 11:44.480
There are too many of them and I won't review all of them for now.

11:44.500 --> 11:53.650
For now I just need this property active database copy so I need to know for sure which server holds

11:53.770 --> 11:59.330
active database copy and which service called active copy.

11:59.350 --> 12:09.250
So now I can type get mailbox database corpus status them on to select mailbox server and active database

12:09.280 --> 12:10.680
copy properties.

12:10.720 --> 12:16.200
Let me type mailbox server comma active database copy.

12:16.420 --> 12:24.610
And now we know for sure which server halts active database copy and to which servers it's replicated

12:24.890 --> 12:27.270
in this case it's x 2.

12:27.290 --> 12:36.330
Now I know for sure which server to use if I want to remove active mail database copy so I'll type remove

12:36.540 --> 12:43.850
mail box database copy them on to backslash X to for.

12:43.850 --> 12:48.560
I'll run this command was whatever parameter to see what will happen.

12:48.670 --> 12:56.390
And as you can see the result is removal and database copy for database demo 2 on Sora x 2.

12:56.530 --> 12:58.120
Exactly what I needed.
