You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
return"The TAP for this user is $($GraphRequest.temporaryAccessPass) - This TAP is usable for the next $($GraphRequest.LifetimeInMinutes) minutes"
14
+
return [pscustomobject]@{ resultText="The TAP for this user is $($GraphRequest.temporaryAccessPass) - This TAP is usable for the next $($GraphRequest.LifetimeInMinutes) minutes"
15
+
copyField=$($GraphRequest.temporaryAccessPass)
16
+
state='success'
17
+
}
18
+
15
19
} catch {
16
20
$ErrorMessage=Get-CippException-Exception $_
17
21
Write-LogMessage-user $ExecutingUser-API $APIName-message "Failed to created TAP for $($userid): $($ErrorMessage.NormalizedError)"-Sev 'Error'-tenant $TenantFilter-LogData $ErrorMessage
18
-
Return"Failed to create TAP: $($ErrorMessage.NormalizedError)"
22
+
Return [pscustomobject]@{ resultText="Failed to create TAP: $($ErrorMessage.NormalizedError)"
Copy file name to clipboardExpand all lines: Modules/CIPPCore/Public/Set-CIPPResetPassword.ps1
+15-6Lines changed: 15 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -26,15 +26,24 @@ function Set-CIPPResetPassword {
26
26
$password=$PasswordLink
27
27
}
28
28
Write-LogMessage-user $ExecutingUser-API $APIName-message "Reset the password for $($userid). User must change password is set to $forceChangePasswordNextSignIn"-Sev 'Info'-tenant $TenantFilter
29
-
30
-
if($UserDetails.onPremisesSyncEnabled-eq$true){
31
-
return"Reset the password for $($userid). User must change password is set to $forceChangePasswordNextSignIn. The new password is $password. WARNING: This user is AD synced. Please confirm passthrough or writeback is enabled."
32
-
}else{
33
-
return"Reset the password for $($userid). User must change password is set to $forceChangePasswordNextSignIn. The new password is $password"
29
+
30
+
if ($UserDetails.onPremisesSyncEnabled-eq$true) {
31
+
return [pscustomobject]@{ resultText="Reset the password for $($userid). User must change password is set to $forceChangePasswordNextSignIn. The new password is $password. WARNING: This user is AD synced. Please confirm passthrough or writeback is enabled."
32
+
copyField=$password
33
+
state='warning'
34
+
}
35
+
} else {
36
+
return [pscustomobject]@{ resultText="Reset the password for $($userid). User must change password is set to $forceChangePasswordNextSignIn. The new password is $password"
37
+
copyField=$password
38
+
state='success'
39
+
}
34
40
}
35
41
} catch {
36
42
$ErrorMessage=Get-CippException-Exception $_
37
43
Write-LogMessage-user $ExecutingUser-API $APIName-message "Could not reset password for $($userid). Error: $($ErrorMessage.NormalizedError)"-Sev 'Error'-tenant $TenantFilter-LogData $ErrorMessage
38
-
return"Could not reset password for $($userid). Error: $($ErrorMessage.NormalizedError)"
44
+
return [pscustomobject]@{
45
+
resultText="Could not reset password for $($userid). Error: $($ErrorMessage.NormalizedError)"
0 commit comments