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
.Administration.Automation.SetUser
You may see something different but similar depending on which Parameter you are setting.
Error Image:
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).
Solution:
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
Note:
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.
[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”
This error is occurring on accounts that are NOT dirsync’d with on-prem AD. How can that be removed?
Hello,
Have you run that command – If so did it have any effect?
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”
can we do it only for particular domain?
Hi,
You can only sync one domain as far as I know.