entra-powershell icon indicating copy to clipboard operation
entra-powershell copied to clipboard

Set-EntraDirSyncFeature should process multiple features at once

Open SteveMutungi254 opened this issue 1 year ago • 1 comments

Describe the feature A clear and concise description of this feature. Please describe what the feature does. You’ll be asked why it is important later.

Customer feedback:

It would also be nice if the cmdlet could process multiple features at one time i.e.. accept an array instead of a string for the feature parameter given that there are 19 features that can be activated - Tony Redmond

Set-EntraDirSyncFeature -Feature PasswordSync,PasswordWriteBack,UserWriteBack -Enabled:$true Set-EntraDirSyncFeature: Cannot process argument transformation on parameter 'Feature'. Cannot convert value to type System.String.

How will this feature enhance your project and further the project’s overall goals? Who will benefit from this feature (i.e. all users; the project team)? A concise statement about the importance of the feature and the impact it should have on your project.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

SteveMutungi254 avatar Oct 23 '24 14:10 SteveMutungi254

The Graph SDK cmdlet allows you to modify multiple settings at one time, so the Entra cmdlet should do so too

$SyncId = Get-MgDirectoryOnPremiseSynchronization | Select-Object -ExpandProperty Id $Features = @{} $Features.Add("softMatchOnUpnEnabled",$true) $Features.Add("synchronizeUpnForManagedUsersEnabled",$true) $Parameters = @{} $Parameters.Add("features",$Features) Update-MgDirectoryOnPremiseSynchronization -OnPremisesDirectorySynchronizationId $SyncId -BodyParameter $Parameters

12Knocksinna avatar Oct 23 '24 14:10 12Knocksinna

Set-EntraDirSyncFeature calls the Graph cmdlet Update-MgDirectoryOnPremiseSynchronization https://github.com/microsoftgraph/entra-powershell/blob/3fa0e2762e30ccba1abb7aba2a2ff680c3f1bcb5/module/Entra/Microsoft.Entra/DirectoryManagement/Set-EntraDirSyncFeature.ps1#L91

KenitoInc avatar Aug 07 '25 03:08 KenitoInc