Skip to content

Commit b862e05

Browse files
committed
We should get more than 1 user at a time...
1 parent 3b917c6 commit b862e05

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Identity/Administration/Users/Invoke-ListUserCounts.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ Function Invoke-ListUserCounts {
2222
@{
2323
id = 'Users'
2424
method = 'GET'
25-
url = "/users?`$count=true&`$top=1"
25+
url = "/users?`$count=true&`$top=999"
2626
headers = @{
2727
'ConsistencyLevel' = 'eventual'
2828
}
2929
}
3030
@{
3131
id = 'LicUsers'
3232
method = 'GET'
33-
url = "/users?`$count=true&`$top=1&`$filter=assignedLicenses/`$count ne 0"
33+
url = "/users?`$count=true&`$top=999&`$filter=assignedLicenses/`$count ne 0"
3434
headers = @{
3535
'ConsistencyLevel' = 'eventual'
3636
}
@@ -46,7 +46,7 @@ Function Invoke-ListUserCounts {
4646
@{
4747
id = 'Guests'
4848
method = 'GET'
49-
url = "/users?`$count=true&`$top=1&`$filter=userType eq 'Guest'"
49+
url = "/users?`$count=true&`$top=999&`$filter=userType eq 'Guest'"
5050
headers = @{
5151
'ConsistencyLevel' = 'eventual'
5252
}
@@ -58,12 +58,12 @@ Function Invoke-ListUserCounts {
5858

5959
# Check if any requests failed
6060
$FailedRequests = $BulkResults | Where-Object { $_.status -ne 200 }
61-
61+
6262
if ($FailedRequests) {
6363
# If any requests failed, return an error response
6464
$FailedIds = ($FailedRequests | ForEach-Object { $_.id }) -join ', '
6565
$ErrorMessage = "Failed to retrieve counts for: $FailedIds"
66-
66+
6767
return ([HttpResponseContext]@{
6868
StatusCode = [HttpStatusCode]::InternalServerError
6969
Body = @{

0 commit comments

Comments
 (0)