1
00:00:02,868 --> 00:00:04,679
Next up, let's talk about how to connect

2
00:00:04,679 --> 00:00:08,987
to SharePoint Online with PowerShell. How

3
00:00:08,987 --> 00:00:11,201
do we get the module? The SharePoint

4
00:00:11,201 --> 00:00:14,245
Online PowerShell module is hosted on the

5
00:00:14,245 --> 00:00:17,258
PowerShell Gallery. The PowerShell Gallery

6
00:00:17,258 --> 00:00:20,940
is the central repository for PowerShell

7
00:00:20,940 --> 00:00:23,923
content from Microsoft, as well as from

8
00:00:23,923 --> 00:00:26,543
the community. To download modules from

9
00:00:26,543 --> 00:00:31,132
the PowerShell Gallery, you need to have

10
00:00:31,132 --> 00:00:33,479
PowerShellGet. You might already have

11
00:00:33,479 --> 00:00:36,022
PowerShellGet and I think most of you

12
00:00:36,022 --> 00:00:37,550
probably already have PowerShellGet,

13
00:00:37,550 --> 00:00:41,312
because it's included with Windows 10 or

14
00:00:41,312 --> 00:00:44,765
newer, Windows Server 2016 or newer

15
00:00:44,765 --> 00:00:48,126
operating systems, if you have the Windows

16
00:00:48,126 --> 00:00:52,738
Management Framework 5.0 or newer, or if

17
00:00:52,738 --> 00:00:56,133
you have PowerShell 6. If you have an

18
00:00:56,133 --> 00:00:58,207
older version of Windows or PowerShell,

19
00:00:58,207 --> 00:01:00,229
just download the PackageManagement MSI

20
00:01:00,229 --> 00:01:03,948
from the Download link in the slides or

21
00:01:03,948 --> 00:01:07,125
simply search Package Management MSI in

22
00:01:07,125 --> 00:01:10,332
your favorite search engine. After you

23
00:01:10,332 --> 00:01:12,555
have the requirement, you simply need to

24
00:01:12,555 --> 00:01:14,917
run the Install-Module cmdlet and specify

25
00:01:14,917 --> 00:01:18,257
the name of the module, which is

26
00:01:18,257 --> 00:01:20,069
Microsoft.Online .SharePoint .PowerShell.

27
00:01:20,069 --> 00:01:23,089
It will ask you to confirm a few things,

28
00:01:23,089 --> 00:01:25,848
and then it will download everything for

29
00:01:25,848 --> 00:01:28,985
you. In order to connect, you need to be a

30
00:01:28,985 --> 00:01:31,878
SharePoint Online administrator, and you

31
00:01:31,878 --> 00:01:34,359
need to know the url of the SharePoint

32
00:01:34,359 --> 00:01:37,295
Online admin center, which is always in

33
00:01:37,295 --> 00:01:41,974
the form of https://tenant name -

34
00:01:41,974 --> 00:01:45,095
admin.sharepoint .com. You need to open up

35
00:01:45,095 --> 00:01:46,757
the SharePoint Online management shell or

36
00:01:46,757 --> 00:01:49,487
a normal partial window and import the

37
00:01:49,487 --> 00:01:52,169
SharePoint Online module, then get the

38
00:01:52,169 --> 00:01:55,867
credential and save it in a variable, and

39
00:01:55,867 --> 00:01:59,667
finally establish a connection using the

40
00:01:59,667 --> 00:02:01,985
Connect-SPOService cmdlet, specifying the

41
00:02:01,985 --> 00:02:05,319
URL of the SharePoint Online admin center,

42
00:02:05,319 --> 00:02:08,622
and you can view in this case the URL of

43
00:02:08,622 --> 00:02:11,231
my SharePoint Online admin center is

44
00:02:11,231 --> 00:02:15,507
globamanticsorg- admin.sharepoint .com and

45
00:02:15,507 --> 00:02:19,052
then give it the credential. If you are

46
00:02:19,052 --> 00:02:20,988
using multi-factor authentication, you

47
00:02:20,988 --> 00:02:24,083
need to run the Connect-SPOService partial

48
00:02:24,083 --> 00:02:28,209
cmdlet and you would not give it a

49
00:02:28,209 --> 00:02:30,888
credential; you're simply going to have a

50
00:02:30,888 --> 00:02:33,852
web login or pop-up window opening up,

51
00:02:33,852 --> 00:02:36,178
which we're going to be able to enter your

52
00:02:36,178 --> 00:02:38,277
username, password, and then it will ask

53
00:02:38,277 --> 00:02:44,000
you for your second method of authentication.

