1
00:00:02,540 --> 00:00:05,380
Now that we have seen why it's important

2
00:00:05,380 --> 00:00:08,350
to have the user profile field, let's take

3
00:00:08,350 --> 00:00:11,460
a look at how we can report on user

4
00:00:11,460 --> 00:00:14,750
profile completeness. We are now in the

5
00:00:14,750 --> 00:00:16,910
lab environment, so let me open up the

6
00:00:16,910 --> 00:00:19,930
PowerShell ISE. The first thing that we

7
00:00:19,930 --> 00:00:22,030
need to do is connect to all of the

8
00:00:22,030 --> 00:00:25,050
required services, and here in this

9
00:00:25,050 --> 00:00:27,950
particular demo, I have connected to some

10
00:00:27,950 --> 00:00:31,585
services that we have not covered in this

11
00:00:31,585 --> 00:00:34,680
course. However, because it's important to

12
00:00:34,680 --> 00:00:36,500
give you an idea about the whole user

13
00:00:36,500 --> 00:00:39,810
profile, including the Azure AD one, it's

14
00:00:39,810 --> 00:00:42,440
important to cover all of them, but if you

15
00:00:42,440 --> 00:00:45,130
want to learn more about PowerShell and

16
00:00:45,130 --> 00:00:48,420
the other Office 365 services, there's a

17
00:00:48,420 --> 00:00:51,215
PowerShell for Office 365 course on

18
00:00:51,215 --> 00:00:54,890
Pluralsight. But back to this demo, I have

19
00:00:54,890 --> 00:00:57,430
connected to Exchange Online, Sharepoint

20
00:00:57,430 --> 00:00:59,067
Online, and PnPOnline, so Sharepoint

21
00:00:59,067 --> 00:01:03,300
Online using the PnP module, and then

22
00:01:03,300 --> 00:01:06,320
Azure Active Directory. Now let's take a

23
00:01:06,320 --> 00:01:08,810
look at one that has to do with

24
00:01:08,810 --> 00:01:12,370
SharePoint, which is the AboutMe. The

25
00:01:12,370 --> 00:01:14,644
first thing that I will do is I will do a

26
00:01:14,644 --> 00:01:18,440
Get‑AzureADUser exactly like we did in the

27
00:01:18,440 --> 00:01:21,080
slides where the userType is Member and

28
00:01:21,080 --> 00:01:25,090
AssignedLicenses is not Null. Then I will

29
00:01:25,090 --> 00:01:27,713
create an empty array called

30
00:01:27,713 --> 00:01:31,380
NoAboutMeUsers. And then I will look

31
00:01:31,380 --> 00:01:34,240
through all of the users. In order to get

32
00:01:34,240 --> 00:01:36,830
the user profile because the AboutMe is

33
00:01:36,830 --> 00:01:40,060
only a SharePoint Online property and not

34
00:01:40,060 --> 00:01:42,280
an Azure AD one, we're going to look

35
00:01:42,280 --> 00:01:43,710
directly into the

36
00:01:43,710 --> 00:01:47,370
Get‑PnPUserProfileProperty and look into

37
00:01:47,370 --> 00:01:49,920
the userPrincipalName, and I have an

38
00:01:49,920 --> 00:01:53,330
ErrorAction SilentlyContinue. Why do I

39
00:01:53,330 --> 00:01:56,100
have this is because that user might be

40
00:01:56,100 --> 00:01:59,060
licensed. However, they might not have

41
00:01:59,060 --> 00:02:00,850
ever logged into SharePoint, or it might

42
00:02:00,850 --> 00:02:02,890
be a brand‑new user, and they might not

43
00:02:02,890 --> 00:02:05,410
have the SharePoint Online user profile

44
00:02:05,410 --> 00:02:08,420
yet. So I just have an if here if the

45
00:02:08,420 --> 00:02:12,520
profile is not Null. Then I will look in

46
00:02:12,520 --> 00:02:14,390
the SharePoint profile, so the variable

47
00:02:14,390 --> 00:02:17,800
that I got. UserProfileProperties AboutMe

48
00:02:17,800 --> 00:02:20,810
is nothing, and if it's nothing, it means

49
00:02:20,810 --> 00:02:23,845
that user doesn't have an AboutMe, so I'll

50
00:02:23,845 --> 00:02:26,989
just add it to the array. And at the end,

51
00:02:26,989 --> 00:02:31,730
I will export everything to a CSV file. So

52
00:02:31,730 --> 00:02:34,410
let me just go into see Office 365

53
00:02:34,410 --> 00:02:36,870
reports, and I will have the

54
00:02:36,870 --> 00:02:40,349
UsersWithNoAboutMe in CSV format so that

55
00:02:40,349 --> 00:02:44,070
makes it easy to open with Excel, and I

56
00:02:44,070 --> 00:02:45,780
will have the DisplayName and

57
00:02:45,780 --> 00:02:48,730
UserPrincipalName. Now let's take a look

58
00:02:48,730 --> 00:02:50,700
at some other ones. Remember, you're going

59
00:02:50,700 --> 00:02:53,230
to be able to have access to all of them

60
00:02:53,230 --> 00:02:55,950
as part of the demo downloads of this

61
00:02:55,950 --> 00:02:58,970
course. The Manager one that we have shown

62
00:02:58,970 --> 00:02:59,298
in the slides, it's

63
00:02:59,298 --> 00:03:04,090
Get‑AzureADUserManager. The Picture one

64
00:03:04,090 --> 00:03:06,105
because, as we have mentioned in this

65
00:03:06,105 --> 00:03:08,740
course, the picture is stored in Exchange

66
00:03:08,740 --> 00:03:11,100
Online, so we actually have to look in

67
00:03:11,100 --> 00:03:13,370
Exchange Online. So I'm using the

68
00:03:13,370 --> 00:03:17,520
Get‑UserPhoto PowerShell cmdlet. The logic

69
00:03:17,520 --> 00:03:20,400
is the same for every single one of those

70
00:03:20,400 --> 00:03:22,590
scripts. So every single one of those

71
00:03:22,590 --> 00:03:25,258
scripts gets all of the users that are a

72
00:03:25,258 --> 00:03:27,630
member and not licensed, looks through

73
00:03:27,630 --> 00:03:31,390
them, looks at that specific property, and

74
00:03:31,390 --> 00:03:33,650
if it's not there, if it's empty, we're

75
00:03:33,650 --> 00:03:36,080
going to add it to an array and export it

76
00:03:36,080 --> 00:03:40,940
to CSV. Projects is in SharePoint, so I

77
00:03:40,940 --> 00:03:43,840
have it here. Skills, as well as in

78
00:03:43,840 --> 00:03:47,750
SharePoint properties, SPS‑Skills. One

79
00:03:47,750 --> 00:03:50,070
that's important because remember that we

80
00:03:50,070 --> 00:03:52,590
have looked during the past demo that the

81
00:03:52,590 --> 00:03:56,020
cell phone is not automatically synced

82
00:03:56,020 --> 00:03:58,810
from Azure AD to Sharepoint. So for the

83
00:03:58,810 --> 00:04:01,180
cell phone, we actually have to look in

84
00:04:01,180 --> 00:04:04,435
both Azure AD, so really looking in Azure

85
00:04:04,435 --> 00:04:07,670
AD where the user.Mobile equals Null, as

86
00:04:07,670 --> 00:04:10,200
well as looking to SharePoint where the

87
00:04:10,200 --> 00:04:11,260
SharePoint profile

88
00:04:11,260 --> 00:04:14,010
UserProfileProperties.CellPhone is

89
00:04:14,010 --> 00:04:18,140
nothing. So you can use the script for

90
00:04:18,140 --> 00:04:21,190
both out‑of‑the‑box properties, as well as

91
00:04:21,190 --> 00:04:23,450
custom ones. I'm not going to run through

92
00:04:23,450 --> 00:04:25,880
all of them because it's all the same

93
00:04:25,880 --> 00:04:27,470
logic, and it's important that you

94
00:04:27,470 --> 00:04:29,460
understand the logic, and you can play

95
00:04:29,460 --> 00:04:31,740
around with the properties afterwards

96
00:04:31,740 --> 00:04:33,810
because you have access to all of those

97
00:04:33,810 --> 00:04:36,850
scripts when you download the exercise

98
00:04:36,850 --> 00:04:39,090
files. This is it for user profile

99
00:04:39,090 --> 00:04:42,130
completeness reporting using PowerShell.

100
00:04:42,130 --> 00:04:48,000
Now let's go back to the slides and finish off this module.

