Object reference not set to an instance of an object error while enabling CloudPBX

By | December 4, 2016

A couple weeks ago I came across a client issue enabling CloudPBX for Skype for Business Online users. The correct Set-CsUser command that would normally enable users, was bleeding red errors in PowerShell. The command is pretty straight forward and was successful the day before.
An example command:

set-csuser -identity usersipaddress@domain.com -EnterpriseVoiceEnabled $True -HostedVoiceMail $True -OnPremLineURI tel:+12345678901

Instead of enabling the specific user for CloudPBX, PowerShell returned an “Object reference not set to an instance of an object” error. Stripping down the cmdlet, it was determined that the error occurs when attempting to set the EnterpriseVoiceEnabled parameter on Set-CsUser to $True.

objerr
objerr1

After hitting up the MVP Community, I have found this is occurring globally and randomly within Office365.

Although I can’t explain what triggers the issue, I have come up with the following workaround that can help others that are experiencing the (hopefully temporary) issue that could be preventing CloudPBX deployments.

The fix is to set the HostedVoiceMail parameter on Set-CSUser to $True alone without any other parameters, after doing so wait ~10 seconds and run your original Set-CsUser command setting the Enterprise Voice parameters and all is successful. If HostedVoiceMail is already $True and seeing the issue with EnterpriseVoiceEnabled, toggle HostedVoiceMail to $False and back to $true and should be good to go.
objerr2

objerr3

2 thoughts on “Object reference not set to an instance of an object error while enabling CloudPBX

  1. Dan Walker

    In our case, the fix was to enable voice on premise, run a dir sync, wait a few minutes, and then run our enable command at that point

    Reply
    1. mlamontagne Post author

      Good to know, only have come across the issue for pure CloudPBX without Hybrid.

      Reply

Leave a Comment