From 01ce74db4bde0d539af9379d81e15db37ed839a1 Mon Sep 17 00:00:00 2001 From: Adam Willford Date: Wed, 16 Mar 2022 12:11:27 +0000 Subject: [PATCH] Removed aspect where it only updates fields with values to fix removing attribs --- EditUser/run.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EditUser/run.ps1 b/EditUser/run.ps1 index b51da80a5754..b37270f2a804 100644 --- a/EditUser/run.ps1 +++ b/EditUser/run.ps1 @@ -34,7 +34,7 @@ try { "forceChangePasswordNextSignIn" = [bool]$UserObj.mustchangepass } } | ForEach-Object { - $NonEmptyProperties = $_.psobject.Properties | Where-Object { $_.Value } | Select-Object -ExpandProperty Name + $NonEmptyProperties = $_.psobject.Properties | Select-Object -ExpandProperty Name $_ | Select-Object -Property $NonEmptyProperties | ConvertTo-Json } $GraphRequest = New-GraphPostRequest -uri "https://graph.microsoft.com/beta/users/$($userobj.Userid)" -tenantid $Userobj.tenantid -type PATCH -body $BodyToship -verbose