SOLVED

Exchange Online error: Write-ErrorMessage : Object reference not set to an instance of an object.

Copper Contributor

I am unable to Modify ab Authentication Policy : Set-AuthenticationPolicy -Identity "Block Basic Auth" -AllowBasicAuthImap:$false

 

I get the below error: 

 

Write-ErrorMessage : Object reference not set to an instance of an object.

 

When apply the Authentication Policy to a user using Set-CASMailbox it does not change anything. Kindly help. Thank you.

3 Replies
I have the same error message when trying to run this command. I tried also Cloud Shell/ PowerShell from Azure portal and here I got the same error: "Set-AuthenticationPolicy: Object reference not set to an instance of an object."
best response confirmed by Edwin_Oroko (Copper Contributor)
Solution

@Edwin_Oroko 

For me the solution was creation of new policy with all the desired parameters in one command. It is strange, but it is working :)

 

Try to run the following command.:

New-AuthenticationPolicy -Identity "Block Basic Auth_v2" -AllowBasicAuthPop:$false -AllowBasicAuthSmtp:$false

 

Do not forget to put all the parameters to command. Edit of policy via Set-AuthenticationPolicy  is (currently) not working. You cannot edit it later.

 

@matacek Thank you! Yes, seems one cannot edit it later.

1 best response

Accepted Solutions
best response confirmed by Edwin_Oroko (Copper Contributor)
Solution

@Edwin_Oroko 

For me the solution was creation of new policy with all the desired parameters in one command. It is strange, but it is working :)

 

Try to run the following command.:

New-AuthenticationPolicy -Identity "Block Basic Auth_v2" -AllowBasicAuthPop:$false -AllowBasicAuthSmtp:$false

 

Do not forget to put all the parameters to command. Edit of policy via Set-AuthenticationPolicy  is (currently) not working. You cannot edit it later.

 

View solution in original post