1
00:00:02,365 --> 00:00:04,030
We have now learned how to connect to

2
00:00:04,030 --> 00:00:06,514
SharePoint Online using the Microsoft

3
00:00:06,514 --> 00:00:09,111
provided modules, but I also want to teach

4
00:00:09,111 --> 00:00:13,027
you how to connect to Office 365 using the

5
00:00:13,027 --> 00:00:16,227
Office 365 Dev PnP PowerShell cmdlets,

6
00:00:16,227 --> 00:00:18,900
which you might not know about since it's

7
00:00:18,900 --> 00:00:24,379
not an official Microsoft module. So let's

8
00:00:24,379 --> 00:00:27,252
first find out what they are. The Office

9
00:00:27,252 --> 00:00:30,863
365 Dev PnP, which stands for Patterns and

10
00:00:30,863 --> 00:00:34,305
Practices is an open source initiative by

11
00:00:34,305 --> 00:00:37,285
the SharePoint engineering group at

12
00:00:37,285 --> 00:00:38,957
Microsoft, which contains multiple

13
00:00:38,957 --> 00:00:42,103
solutions, best practices, and code

14
00:00:42,103 --> 00:00:47,019
samples on how to do more with Office 365

15
00:00:47,019 --> 00:00:49,634
and SharePoint. One of the awesome

16
00:00:49,634 --> 00:00:52,628
solutions is the SharePoint and Office 365

17
00:00:52,628 --> 00:00:56,303
Dev PnP PowerShell Cmdlets, which include

18
00:00:56,303 --> 00:00:59,338
over 400 PowerShell cmdlets that allow you

19
00:00:59,338 --> 00:01:02,069
to do a lot more than what you can do with

20
00:01:02,069 --> 00:01:05,039
the Microsoft provided SharePoint Online

21
00:01:05,039 --> 00:01:08,559
PowerShell module. How do we get it? Well,

22
00:01:08,559 --> 00:01:12,042
the PnP PowerShell module is hosted on the

23
00:01:12,042 --> 00:01:14,208
PowerShell Gallery as well so the same

24
00:01:14,208 --> 00:01:16,872
thing as the SharePoint Online module, and

25
00:01:16,872 --> 00:01:19,157
the same prerequisites as the SharePoint

26
00:01:19,157 --> 00:01:22,486
Online module as well. In order to install

27
00:01:22,486 --> 00:01:25,545
it, we're going to run the Install-Module

28
00:01:25,545 --> 00:01:28,163
PowerShell cmdlet and then specified the

29
00:01:28,163 --> 00:01:32,176
name of the cmdlet, which is

30
00:01:32,176 --> 00:01:34,281
SharePointPnPPowerShellOnline. To connect,

31
00:01:34,281 --> 00:01:36,367
you need to be a SharePoint Online admin

32
00:01:36,367 --> 00:01:39,295
in order to manage things at the tenant

33
00:01:39,295 --> 00:01:42,190
level, like for example create a new site

34
00:01:42,190 --> 00:01:45,377
collection or play with hub sites and

35
00:01:45,377 --> 00:01:48,446
things like that. You can also simply be a

36
00:01:48,446 --> 00:01:50,736
site collection administrator if you only

37
00:01:50,736 --> 00:01:53,842
want to manage only a single site

38
00:01:53,842 --> 00:01:56,333
collection, and lastly, you'll need the

39
00:01:56,333 --> 00:01:59,044
URL of the site collection you want to

40
00:01:59,044 --> 00:02:01,161
manage or the URL of the SharePoint Online

41
00:02:01,161 --> 00:02:04,668
admin center if you want to manage tenant

42
00:02:04,668 --> 00:02:08,611
level settings. To connect, you simply get

43
00:02:08,611 --> 00:02:11,168
the credential and then run the

44
00:02:11,168 --> 00:02:12,347
Connect-PnPOnline PowerShell cmdlet

45
00:02:12,347 --> 00:02:15,742
specifying the URL of the site you want to

46
00:02:15,742 --> 00:02:18,165
connect to. So remember the tenant admin

47
00:02:18,165 --> 00:02:21,405
site or the SharePoint Online admin center

48
00:02:21,405 --> 00:02:23,592
URL, if you want to manage something

49
00:02:23,592 --> 00:02:26,098
across the tenant or create a new site

50
00:02:26,098 --> 00:02:28,859
collection and things like that, or the

51
00:02:28,859 --> 00:02:31,326
URL of the site collection that you want

52
00:02:31,326 --> 00:02:33,242
to manage specifically, and then give it

53
00:02:33,242 --> 00:02:36,664
your credential object. If you want to

54
00:02:36,664 --> 00:02:39,450
connect to SharePoint Online using the PnP

55
00:02:39,450 --> 00:02:42,388
module with multifactor authentication, it

56
00:02:42,388 --> 00:02:44,729
would still be the Connect-PnPOnline

57
00:02:44,729 --> 00:02:47,497
partial cmdlet, but we wouldn't be able to

58
00:02:47,497 --> 00:02:49,722
save that credential object so we're going

59
00:02:49,722 --> 00:02:52,788
to give it the -UseWebLogin switch

60
00:02:52,788 --> 00:02:55,061
parameter, which will open the pop-up

61
00:02:55,061 --> 00:02:58,294
required so we can enter our username and

62
00:02:58,294 --> 00:03:04,000
password, as well as second authentication method.

