1
00:00:02,784 --> 00:00:06,652
Now let's talk a bit about reporting. We

2
00:00:06,652 --> 00:00:08,338
have already talked about why the User

3
00:00:08,338 --> 00:00:10,913
Profile is important so setting up reports

4
00:00:10,913 --> 00:00:13,639
to make sure that the user profile

5
00:00:13,639 --> 00:00:16,821
information is entered everywhere can be a

6
00:00:16,821 --> 00:00:20,174
good administrative task to do, using

7
00:00:20,174 --> 00:00:23,516
Microsoft tools, only PowerShell is really

8
00:00:23,516 --> 00:00:26,800
the only reporting option. There are also

9
00:00:26,800 --> 00:00:28,657
third-party tools out there that can do

10
00:00:28,657 --> 00:00:30,920
it, but we won't cover this in this

11
00:00:30,920 --> 00:00:33,611
course. We're really going to cover the

12
00:00:33,611 --> 00:00:36,880
Microsoft way by using PowerShell. In

13
00:00:36,880 --> 00:00:38,771
order to really access everything, you

14
00:00:38,771 --> 00:00:41,485
need to have the SharePoint Online module,

15
00:00:41,485 --> 00:00:45,299
Exchange Online module, Azure AD modules,

16
00:00:45,299 --> 00:00:49,271
and the SharePoint PnP module. For the

17
00:00:49,271 --> 00:00:52,986
module export, you can export it to CSV,

18
00:00:52,986 --> 00:00:57,283
HTML, XML, or to really anything that

19
00:00:57,283 --> 00:00:59,631
PowerShell works with, and if you want to

20
00:00:59,631 --> 00:01:01,682
know how to do fancy reports with

21
00:01:01,682 --> 00:01:04,362
PowerShell, there are a few cool courses

22
00:01:04,362 --> 00:01:07,728
on Pluralsight on those topics. Now let me

23
00:01:07,728 --> 00:01:10,544
give you an example in the slides and then

24
00:01:10,544 --> 00:01:13,606
we'll do more in the demos. First of all,

25
00:01:13,606 --> 00:01:16,416
let's say that we want to get all of the

26
00:01:16,416 --> 00:01:18,510
users that do not have a manager. First of

27
00:01:18,510 --> 00:01:21,845
all, I will get all of my users and save

28
00:01:21,845 --> 00:01:25,090
them in a variable. I will filter where

29
00:01:25,090 --> 00:01:27,616
the user type is Member. This means that

30
00:01:27,616 --> 00:01:30,034
it's a user internal to the company and

31
00:01:30,034 --> 00:01:32,801
not a guest, and where the assigned

32
00:01:32,801 --> 00:01:37,022
license is not null. This way I don't get

33
00:01:37,022 --> 00:01:39,580
accounts that are not using Office 365;

34
00:01:39,580 --> 00:01:42,031
maybe those are service accounts or things

35
00:01:42,031 --> 00:01:44,086
like that. We really want to focus on the

36
00:01:44,086 --> 00:01:46,759
ones that have a license and of course,

37
00:01:46,759 --> 00:01:50,096
you can customize it further according to

38
00:01:50,096 --> 00:01:52,489
your needs. I will then initialize an

39
00:01:52,489 --> 00:01:55,789
array called NoManagerUsers, which will be

40
00:01:55,789 --> 00:01:58,509
an empty array, and next up, we will look

41
00:01:58,509 --> 00:02:01,604
through each user that we got earlier and

42
00:02:01,604 --> 00:02:05,277
get the manager of that user by using the

43
00:02:05,277 --> 00:02:09,001
Get-AzureADUserManager PowerShell cmdlet.

44
00:02:09,001 --> 00:02:12,270
If nothing is returned, so if the manager

45
00:02:12,270 --> 00:02:15,193
is null, we will add the user to the array

46
00:02:15,193 --> 00:02:18,273
that we have created earlier of users with

47
00:02:18,273 --> 00:02:21,654
no manager. Lastly, we'll save the users

48
00:02:21,654 --> 00:02:30,000
with no manager inside a CSV file for easy reporting.

