SitecorePowerShell / Book

Sitecore PowerShell Extensions - The Book
https://doc.sitecorepowershell.com/
7 stars 19 forks source link

Set-User without -Email property is removing email address from profile #28

Open sandyfoley opened 4 years ago

sandyfoley commented 4 years ago

Hello -

The email address field value is getting deleted from the user profile when using Set-User.

Note that in the code below, the -Email property is not set in Set-User, which is not a required property . 'foo' does exist as a custom property on the profile.

`$users = Get-User -Filter $userFilter foreach ( $user in $users ) {
$profile = $user.Profile $identity = $profile.Username

Set-User -Identity $identity -CustomProperties @{ "foo" = "bar" } }`

This occurs in SPE 5.1. Thanks (again) for this awesome module for Sitecore.