Skip to content

Commit ae5c5e5

Browse files
authored
Merge pull request #458 from KelvinTegelaar/dev
[pull] dev from KelvinTegelaar:dev
2 parents 8cef645 + 45c977e commit ae5c5e5

File tree

5 files changed

+18
-3
lines changed

5 files changed

+18
-3
lines changed

Modules/CIPPCore/Public/Entrypoints/Activity Triggers/BEC/Push-BECRun.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ function Push-BECRun {
143143
Write-Information 'Getting bulk requests'
144144
$GraphResults = New-GraphBulkRequest -Requests $Requests -tenantid $TenantFilter -asapp $true
145145

146-
$PasswordChanges = ($GraphResults | Where-Object { $_.id -eq 'Users' }).body.value | Where-Object { $_.lastPasswordChangeDateTime -ge $startDate } ?? @()
146+
$PasswordChanges = (($GraphResults | Where-Object { $_.id -eq 'Users' }).body.value | Where-Object { $_.lastPasswordChangeDateTime -ge $startDate }) ?? @()
147147
$NewUsers = ($GraphResults | Where-Object { $_.id -eq 'Users' }).body.value | Where-Object { $_.createdDateTime -ge $startDate } ?? @()
148148
$MFADevices = ($GraphResults | Where-Object { $_.id -eq 'MFADevices' }).body.value ?? @()
149149
$NewSPs = ($GraphResults | Where-Object { $_.id -eq 'NewSPs' }).body.value ?? @()

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Endpoint/MEM/Invoke-ListIntuneScript.ps1

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,19 @@ function Invoke-ListIntuneScript {
4848
}
4949

5050
foreach ($scriptId in @('Windows', 'MacOS', 'Remediation', 'Linux')) {
51-
$scripts = ($BulkResults | Where-Object { $_.id -eq $scriptId }).body.value
51+
$BulkResult = ($BulkResults | Where-Object { $_.id -eq $scriptId })
52+
if ($BulkResult.status -ne 200) {
53+
$Results.Add(@{
54+
'scriptType' = $scriptId
55+
'displayName' = if (Test-Json $BulkResult.body.error.message) {
56+
($BulkResult.body.error.message | ConvertFrom-Json).Message
57+
} else {
58+
$BulkResult.body.error.message
59+
}
60+
})
61+
continue
62+
}
63+
$scripts = $BulkResult.body.value
5264

5365
if ($scriptId -eq 'Linux') {
5466
$scripts = $scripts | Where-Object { $_.platforms -eq 'linux' -and $_.templateReference.templateFamily -eq 'deviceConfigurationScripts' }

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using namespace System.Net
22

3-
Function Invoke-AddUser {
3+
function Invoke-AddUser {
44
<#
55
.FUNCTIONALITY
66
Entrypoint
@@ -52,6 +52,7 @@ Function Invoke-AddUser {
5252
'Success' = $CreationResults.CopyFrom.Success
5353
'Error' = $CreationResults.CopyFrom.Error
5454
}
55+
'User' = $CreationResults.User
5556
}
5657
}
5758
# Associate values to output bindings by calling 'Push-OutputBinding'.

Modules/CIPPCore/Public/New-CIPPUserTask.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,5 +83,6 @@ function New-CIPPUserTask {
8383
Username = $CreationResults.Username
8484
Password = $CreationResults.Password
8585
CopyFrom = $CopyFrom
86+
User = $CreationResults.User
8687
}
8788
}

Modules/CIPPCore/Public/New-CippUser.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ function New-CIPPUser {
6666
Results = ('Created New User.')
6767
Username = $UserPrincipalName
6868
Password = $password
69+
User = $GraphRequest
6970
}
7071
} catch {
7172
$ErrorMessage = Get-CippException -Exception $_

0 commit comments

Comments
 (0)