Comments on: Tracking Licensing Costs for Microsoft 365 Tenants https://office365itpros.com/2024/02/14/microsoft-365-licensing-report/?utm_source=rss&utm_medium=rss&utm_campaign=microsoft-365-licensing-report Mastering Office 365 and Microsoft 365 Wed, 03 Jul 2024 10:15:01 +0000 hourly 1 By: Tony Redmond https://office365itpros.com/2024/02/14/microsoft-365-licensing-report/#comment-12521 Wed, 03 Jul 2024 10:15:01 +0000 https://office365itpros.com/?p=63686#comment-12521 In reply to A.

I believe those are the custom attributes from Exchang. It should work fine.

]]>
By: A https://office365itpros.com/2024/02/14/microsoft-365-licensing-report/#comment-12518 Wed, 03 Jul 2024 05:42:33 +0000 https://office365itpros.com/?p=63686#comment-12518 In reply to A.

Hello,
I meant extenstionAttributes synced from on-prem AD to Entra ID.
I’ll try do it myself. 🙂

]]>
By: Tony Redmond https://office365itpros.com/2024/02/14/microsoft-365-licensing-report/#comment-12507 Mon, 01 Jul 2024 11:32:50 +0000 https://office365itpros.com/?p=63686#comment-12507 In reply to A.

What kind of extension attributes? The Entra ID directory extensions (https://practical365.com/directory-extensions-entra-d/) or the custom attributes synchronized from Exchange? In either case, I won’t add them to the script because every organization is different. However, you certainly can add whatever attribute you like by fetching the attributes in the Get-MgUser cmdlet and making sure that the data is output to the report.

]]>
By: A https://office365itpros.com/2024/02/14/microsoft-365-licensing-report/#comment-12506 Mon, 01 Jul 2024 11:22:41 +0000 https://office365itpros.com/?p=63686#comment-12506 In reply to A.

Hi Tony,
I’ve come with another question…
Is it possible for you to add extensionAttributes in script? We use certain extensionAttributes to add cost center for each user… It would be huge to have every user with cost center exported just like department is exported in .csv and .html…

]]>
By: A https://office365itpros.com/2024/02/14/microsoft-365-licensing-report/#comment-12493 Thu, 27 Jun 2024 06:44:53 +0000 https://office365itpros.com/?p=63686#comment-12493 In reply to Tony Redmond.

Indeed, I have 2 accounts where sign in data is not available. After your update it shows last sign in as “Unknown” and there is zero other errors. Thank you so much.

]]>
By: Tony Redmond https://office365itpros.com/2024/02/14/microsoft-365-licensing-report/#comment-12492 Wed, 26 Jun 2024 10:09:23 +0000 https://office365itpros.com/?p=63686#comment-12492 In reply to A.

You must have some accounts where sign in data is not available… In any case, this problem is in the color formatting of the inactive user column, which depends on the number of daus since the last sign-in. I’ve added a check for the condition and all is well in V1.91, available from GitHub now.

]]>
By: A https://office365itpros.com/2024/02/14/microsoft-365-licensing-report/#comment-12491 Wed, 26 Jun 2024 06:27:37 +0000 https://office365itpros.com/?p=63686#comment-12491 In reply to Tony Redmond.

Hello,
New version works flawless! There is no problems with departments anymore, if there is only one person in department now it shows number in “Accounts” 🙂

One last thing is that there are two errors at the end of script – https://imgur.com/QdVmOpN
They were here before – when I send you previous screenshots. They do not cause problems, but I attached them for your information.
Once more – thank you for this script, it is amazing.

]]>
By: Tony Redmond https://office365itpros.com/2024/02/14/microsoft-365-licensing-report/#comment-12488 Tue, 25 Jun 2024 09:30:52 +0000 https://office365itpros.com/?p=63686#comment-12488 In reply to A.

TRy the version I just uploaded to GitHub. I didn’t cast the variables used for $departmentreport and $Countryreport as arrays. PowerShell can be funky about counts when only a single record is returned and the receiving variable isn’t an array… I also changed the match statement to a more conventional Where-Object comparison. Everything seems to work here:

$DepartmentReport

Department Accounts Costs AverageCost
———- ——– —– ———–
Business Development 2 US $ 735.60 US $ 367.80
CEO Office 1 US $ 277.80 US $ 277.80
Cloud Engineering 1 US $ 694.08 US $ 694.08
Cocaine 1 US $ 457.80 US $ 457.80
Editorial 1 US $ 277.80 US $ 277.80
Global HQ 2 US $ 1,451.88 US $ 725.94
Group HQ 1 US $ 277.80 US $ 277.80
Information Security 1 US $ 277.80 US $ 277.80
Information Technology 11 US $ 3,790.56 US $ 344.60
IT Operations 1 US $ 277.80 US $ 277.80
Marketing 1 US $ 277.80 US $ 277.80
Planning & Action 1 US $ 277.80 US $ 277.80
Project Management 2 US $ 735.60 US $ 367.80
Research and Development 2 US $ 555.60 US $ 277.80
Sales 3 US $ 833.40 US $ 277.80
Security Research 1 US $ 457.80 US $ 457.80
Services 1 US $ 694.08 US $ 694.08
Systems Operations 3 US $ 555.60 US $ 185.20

]]>
By: A https://office365itpros.com/2024/02/14/microsoft-365-licensing-report/#comment-12487 Tue, 25 Jun 2024 07:40:00 +0000 https://office365itpros.com/?p=63686#comment-12487 In reply to Tony Redmond.

Hello Tony,
No, of course not. We have like ~40 different department names.
https://imgur.com/oWFZvnd – please see attachment.

When I run [array]$Departments = $Users.Department | Sort-Object -Unique there is every department listed.

Also – error screenshot – https://imgur.com/a/PBkAke5
There are lots of those errors, I guess it runs vs every licensed user account.

]]>
By: Tony Redmond https://office365itpros.com/2024/02/14/microsoft-365-licensing-report/#comment-12484 Mon, 24 Jun 2024 13:19:08 +0000 https://office365itpros.com/?p=63686#comment-12484 In reply to A.

The list of departments is derived from the list of users…

[array]$Departments = $Users.Department | Sort-Object -Unique

If there’s only two departments, do you have only two unique values for department names?

]]>
By: A https://office365itpros.com/2024/02/14/microsoft-365-licensing-report/#comment-12483 Mon, 24 Jun 2024 13:11:19 +0000 https://office365itpros.com/?p=63686#comment-12483 In reply to Tony Redmond.

I’ve run piece of script you’ve pasted and I’ve checked $Reports – it returns every user with department, UPN, Title, etc.
When I run $DepartmentRecords, there are only 2 entries on this list.

]]>
By: Tony Redmond https://office365itpros.com/2024/02/14/microsoft-365-licensing-report/#comment-12482 Mon, 24 Jun 2024 12:53:41 +0000 https://office365itpros.com/?p=63686#comment-12482 In reply to A.

The error is coming when the report script attempts to calculate the cost of licenses assigned to individual departments:

$DepartmentReport = [System.Collections.Generic.List[Object]]::new()
ForEach ($Department in $Departments) {
$DepartmentRecords = $Report | Where-Object {$_.Department -eq $Department}
$DepartmentReportLine = [PSCustomObject][Ordered]@{
Department = $Department
Accounts = $DepartmentRecords.count
Costs = (“{0} {1}” -f $Currency, (‘{0:N2}’ -f ($DepartmentRecords | Measure-Object UserCosts -Sum).Sum))
AverageCost = (“{0} {1}” -f $Currency, (‘{0:N2}’ -f ($DepartmentRecords | Measure-Object UserCosts -Average).Average))
}
$DepartmentReport.Add($DepartmentReportLine)
}

You could check that the departments are correctly captured in the $Report list. You could then check that the $DepartmentRecords list is correct. If that list is not populated, the computations can’t work.

If you want to export your $Report to a CSV file and upload it to somewhere that I can check it, I will have a look.

]]>
By: A https://office365itpros.com/2024/02/14/microsoft-365-licensing-report/#comment-12481 Mon, 24 Jun 2024 12:49:41 +0000 https://office365itpros.com/?p=63686#comment-12481 In reply to Tony Redmond.

I checked and there is whole bunch of department names. What I noticed, this error occurs only if I put price in “SkuDataComplete.csv” file. Without price for MS licenses, this error does not appear.

Department name in this error is really long, might it be a problem?

]]>
By: Tony Redmond https://office365itpros.com/2024/02/14/microsoft-365-licensing-report/#comment-12480 Mon, 24 Jun 2024 12:44:04 +0000 https://office365itpros.com/?p=63686#comment-12480 In reply to A.

What values exist in the department property for user accounts? Type $Users.Department to see…

I don’t see this error here, so it’s likely due to something specific to your tenant.

]]>
By: A https://office365itpros.com/2024/02/14/microsoft-365-licensing-report/#comment-12479 Mon, 24 Jun 2024 12:35:41 +0000 https://office365itpros.com/?p=63686#comment-12479 Hello Tony,
Your script is AMAZING, really thank you for that.
If I may, I have two questions. I encountered error while running PS: “Where-Object : The argument to operator ‘Imatch’ is not valid: parsing “NAME OF DEPARTMENT”. Looks like it runs versus every user account.

And in .html file under “License Cost by Department” if there is only 1 person in department html shows nothing in “Accounts” tab.

If you will find to answer, I will be really grateful, thank you for your amazing work. 🙂

]]>
By: Tony Redmond https://office365itpros.com/2024/02/14/microsoft-365-licensing-report/#comment-12208 Wed, 24 Apr 2024 14:05:13 +0000 https://office365itpros.com/?p=63686#comment-12208 In reply to alexandre.

You’ve got to populate the CSV file with the prices your organization pays Microsoft for licenses. I have no knowledge of what you pay per license.

]]>
By: alexandre https://office365itpros.com/2024/02/14/microsoft-365-licensing-report/#comment-12207 Wed, 24 Apr 2024 12:35:49 +0000 https://office365itpros.com/?p=63686#comment-12207 hello Tony many thanks for your work
i added the price et Currency (EUR) for me, but the script don’t find the price value in the files SKUDATAcomplete.csv could you please provide an template CSV files with price for test

]]>
By: Tony Redmond https://office365itpros.com/2024/02/14/microsoft-365-licensing-report/#comment-11919 Fri, 16 Feb 2024 10:33:06 +0000 https://office365itpros.com/?p=63686#comment-11919 In reply to Chris.

There are details in the script telling you how to generate the SKU and service plan CSVs. The original article (on Practical365.com) explains how by running a script (also available from GitHub). I’ve tweaked the text to make this more obvious.

There’s also details in the script:

# This step depends on the availability of some CSV files generated to hold information about the product licenses used in the tenant and
# the service plans in those licenses. See https://github.com/12Knocksinna/Office365itpros/blob/master/CreateCSVFilesForSKUsAndServicePlans.PS1
# for code to generate the CSVs. After the files are created, you need to edit them to add the display names for the SKUs and plans.
# Build Hash of Skus for lookup so that we report user-friendly display names – you need to create these CSV files from SKU and service plan
# data in your tenant.

]]>
By: Chris https://office365itpros.com/2024/02/14/microsoft-365-licensing-report/#comment-11918 Fri, 16 Feb 2024 09:41:46 +0000 https://office365itpros.com/?p=63686#comment-11918 Thanks for this! where can we find the SkuDataComplete.csv and ServicePlanDataComplete.csv files?

]]>