Skip to content

Commit bca8803

Browse files
authored
Merge pull request #753 from KelvinTegelaar/dev
[pull] dev from KelvinTegelaar:dev
2 parents 337f64f + e3f8284 commit bca8803

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Modules/CIPPCore/Public/Entrypoints/Timer Functions/Start-CIPPStatsTimer.ps1

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function Start-CIPPStatsTimer {
66
[CmdletBinding(SupportsShouldProcess = $true)]
77
param()
88
#These stats are sent to a central server to help us understand how many tenants are using the product, and how many are using the latest version, this information allows the CIPP team to make decisions about what features to support, and what features to deprecate.
9-
#We will never ship any data that is related to your instance, all we care about is the number of tenants, and the version of the API you are running, and if you completed setup.
9+
1010

1111
if ($PSCmdlet.ShouldProcess('Start-CIPPStatsTimer', 'Starting CIPP Stats Timer')) {
1212
if ($env:ApplicationID -ne 'LongApplicationID') {
@@ -25,13 +25,19 @@ function Start-CIPPStatsTimer {
2525
} catch {
2626
$RawExt = @{}
2727
}
28-
28+
$counts = Get-CIPPDbItem -TenantFilter AllTenants -CountsOnly
29+
$userCount = ($counts | Where-Object { $_.RowKey -eq 'Users-Count' } | Measure-Object -Property DataCount -Sum).Sum
30+
$deviceCount = ($counts | Where-Object { $_.RowKey -eq 'Devices-Count' } | Measure-Object -Property DataCount -Sum).Sum
31+
$groupsCount = ($counts | Where-Object { $_.RowKey -eq 'Groups-Count' } | Measure-Object -Property DataCount -Sum).Sum
2932
$SendingObject = [PSCustomObject]@{
3033
rgid = $env:WEBSITE_SITE_NAME
3134
SetupComplete = $SetupComplete
3235
RunningVersionAPI = $APIVersion.trim()
3336
CountOfTotalTenants = $tenantcount
3437
uid = $env:TenantID
38+
UserCount = $userCount
39+
DeviceCount = $deviceCount
40+
GroupsCount = $groupsCount
3541
CIPPAPI = $RawExt.CIPPAPI.Enabled
3642
Hudu = $RawExt.Hudu.Enabled
3743
Sherweb = $RawExt.Sherweb.Enabled

0 commit comments

Comments
 (0)