1
00:00:02,836 --> 00:00:04,962
Now that we have seen the theory, let's go

2
00:00:04,962 --> 00:00:08,122
to the lab and look at how to get the

3
00:00:08,122 --> 00:00:10,069
SharePoint Online PnP PowerShell module,

4
00:00:10,069 --> 00:00:12,735
as well as how to connect to SharePoint

5
00:00:12,735 --> 00:00:17,192
Online using this PnP module. We are now

6
00:00:17,192 --> 00:00:19,261
in the live environment so let me open up

7
00:00:19,261 --> 00:00:22,134
the browser here, and I will search for

8
00:00:22,134 --> 00:00:26,511
SharePoint Online and this time we will

9
00:00:26,511 --> 00:00:28,790
pick the SharePoint PnP PowerShell Online.

10
00:00:28,790 --> 00:00:30,997
Something to really be aware of is that

11
00:00:30,997 --> 00:00:35,455
the PnP module also works for on-premises

12
00:00:35,455 --> 00:00:37,365
SharePoint so if you search for SharePoint

13
00:00:37,365 --> 00:00:40,573
PnP, you'll see SharePoint PnP Online,

14
00:00:40,573 --> 00:00:45,423
PowerShell 2016 and 2013 so make sure that

15
00:00:45,423 --> 00:00:47,743
if you want to connect to Online, you

16
00:00:47,743 --> 00:00:51,158
connect to SharePoint PnP PowerShell

17
00:00:51,158 --> 00:00:53,797
Online. Again, we have the PowerShell

18
00:00:53,797 --> 00:00:56,308
cmdlet here needed to install. It makes it

19
00:00:56,308 --> 00:00:59,437
super easy for us. I will just copy it and

20
00:00:59,437 --> 00:01:02,803
I will paste it in the PowerShell as an

21
00:01:02,803 --> 00:01:04,575
administrator. It seems like it didn't

22
00:01:04,575 --> 00:01:08,319
like me the first time so let me copy and

23
00:01:08,319 --> 00:01:11,824
paste again. Again, it might ask me if I

24
00:01:11,824 --> 00:01:15,731
trust that repository; I'm just going to

25
00:01:15,731 --> 00:01:19,078
say yes. It will take a few seconds, and

26
00:01:19,078 --> 00:01:21,518
it will get installed. Awesome! It

27
00:01:21,518 --> 00:01:24,683
finished installing, now let's connect. I

28
00:01:24,683 --> 00:01:27,326
already have my credential variable from

29
00:01:27,326 --> 00:01:30,128
the previous demo so I'm not going to go

30
00:01:30,128 --> 00:01:33,717
through that step again. I'm only going to

31
00:01:33,717 --> 00:01:37,091
run a Connect-PnPOnline, then I will give

32
00:01:37,091 --> 00:01:39,449
it the URL, which first of all, let's

33
00:01:39,449 --> 00:01:41,457
connect to the SharePoint Online admin

34
00:01:41,457 --> 00:01:44,887
center here. So I will copy this one and

35
00:01:44,887 --> 00:01:48,454
the credentials will be my cred variable.

36
00:01:48,454 --> 00:01:51,168
It will take a few seconds; now I'm

37
00:01:51,168 --> 00:01:53,341
connected. Then I can run things such as

38
00:01:53,341 --> 00:01:56,970
Get-PnPSite for example, and it will show

39
00:01:56,970 --> 00:02:00,209
me the site that I'm currently connected

40
00:02:00,209 --> 00:02:03,651
to. Now if I want to connect to a site

41
00:02:03,651 --> 00:02:05,081
collection, I can simply run a

42
00:02:05,081 --> 00:02:08,197
disconnect-pnp online, and then I'll run

43
00:02:08,197 --> 00:02:11,947
another Connect-PnPOnline, give it the

44
00:02:11,947 --> 00:02:14,590
URL, and this time I just want to show you

45
00:02:14,590 --> 00:02:17,494
that we can actually only connect to a

46
00:02:17,494 --> 00:02:19,920
specific site collection. So I can type in

47
00:02:19,920 --> 00:02:22,632
the URL of that site collection, give it

48
00:02:22,632 --> 00:02:27,368
the credentials here, and it will also

49
00:02:27,368 --> 00:02:29,797
work. So really, with PnP we don't always

50
00:02:29,797 --> 00:02:32,605
connect to the tenant; we only connect to

51
00:02:32,605 --> 00:02:35,444
the tenant if we want to, let's say,

52
00:02:35,444 --> 00:02:37,755
manage all of the different sites if we

53
00:02:37,755 --> 00:02:39,992
want to create site collections or things

54
00:02:39,992 --> 00:02:42,518
like that. But if we only want to manage

55
00:02:42,518 --> 00:02:45,787
content inside a site, we simply connect

56
00:02:45,787 --> 00:02:48,472
to that site, and then I can do, for

57
00:02:48,472 --> 00:02:50,606
example, Get-PnPList, which will show me

58
00:02:50,606 --> 00:02:54,385
all of the different lists inside that

59
00:02:54,385 --> 00:02:57,547
site collection. This is it for this demo.

60
00:02:57,547 --> 00:03:00,194
We have looked at how to go to the partial

61
00:03:00,194 --> 00:03:03,676
gallery, install the SharePoint Online PnP

62
00:03:03,676 --> 00:03:06,029
PowerShell module, and how to connect to

63
00:03:06,029 --> 00:03:08,310
SharePoint Online using this module to

64
00:03:08,310 --> 00:03:11,638
both the admin center, as well as a

65
00:03:11,638 --> 00:03:13,263
specific site collection. Remember that

66
00:03:13,263 --> 00:03:16,033
this is only how to connect, and we're

67
00:03:16,033 --> 00:03:18,218
going to cover a ton of different things

68
00:03:18,218 --> 00:03:20,418
that we can do with both PowerShell

69
00:03:20,418 --> 00:03:26,000
modules we have looked at in the following modules of this course.

