Set-MsolUser command returns a ‘Unable to update parameter’ error

Set-MsolUser command returns a ‘Unable to update parameter’ error

You’re trying to change a user parameter in Office365 via the Set-MsolUser PowerShell Cmdlet but it returns the following error:

Set-MsolUser : Unable to update parameter. Parameter name: DEPARTMENT.
At line:1 char:1
+ Set-MsolUser -UserPrincipalName [email protected] -Department ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [Set-MsolUser], MicrosoftOnlineException
+ FullyQualifiedErrorId : Microsoft.Online.Administration.Automation.PropertyNotSettableException,Microsoft.Online

You may see something different but similar depending on which Parameter you are setting.

Error Image:

Office365 Powershell Error
Set-MsolUser Error

Reason for the Error:

In my situation the reason for the error was due to the Office365 Domain having DirSync Enabled… (Thinking about it, I should have known better).


The Solution to this problem would be to make the required changes to the local Active Directory opposed to Office365. This would then reflect in the Office365 environment upon the next Sync Cycle.

In my situation however, the domain I was using was for testing purposes and I had already removed the AD Sync Server. Therefore I used the below command to Disable DirSync:

Set-MsolDirSyncEnabled -EnableDirSync $false

Obviously you won’t want to use this command if you’re still using DirSync or it will stop syncing…

Once the DirSync had been disabled my command ran successfully.

Disable DirSync

[amazon_link asins=’1509300678,1509304789,B00JLPEL2I’ template=’ProductGrid’ store=’412294wp-21′ marketplace=’UK’ link_id=’90790869-59af-11e8-b72e-cf21e16211d5′]Problem:

5 Replies to “Set-MsolUser command returns a ‘Unable to update parameter’ error”

    1. If you inspect the user object in the O365 admin portal, you can modify a user not synced from on-premises department attribute in “Manage Contact information” under “Phone Number”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.