The parameter is incorrect (WinMgt)” error when refreshing the BizTalk Group in BizTalk Administration Console

Issue:

When refreshing the BizTalk Group, you see the error –
The parameter is incorrect.
 (WinMgmt)
—————————–

Refreshing the BizTalk Group throws the “The parameter is incorrect (WinMgt)” error from BizTalk Administration Console. The problem initially occurred when you tried to add a 32-bit host handler for the FILE-adapter. After applying the host handler, the BizTalk Admin GUI crashed and the error appeared and remained since then. The 32-bit host handler is added to the FILE adapter thought as it appears in the port configurations and registered in the BizTalk’s management database.

Troubleshooting: 

This error is most likely due to a corrupt BizTalk SSO data entry for registering the adapter handlers.

From the debugging log find the application and its corresponding Handlers from the SSO DB.

We would need to delete the receive and Send handlers under that adapter and recreate the Receive and Send Handlers again.

Since we cannot do this via BizTalk Admin Console as it gives the same error when you click on the Adapter, we have to run this though wbemtest.

  1. Go to Run and type : wbemtest 
  2. Click on connect and give the namespace as :  root\MicrosoftBizTalkServer
  3. Click on query and run the cmd :  SELECT * FROM MSBTS_ReceiveHandler and click apply
  4. Post that it will list all the ReceiveHandlers, click on the corresponding Receive handler for File Adapter causing the issue and delete that item. 

The Receive handlers got deleted sucessfully.

  1. Similarly run the cmd: SELECT * FROM MSBTS_SendHandler and delete the corresponding Send handler for File Adapter.

The query SELECT * FROM MSBTS_SendHandler did not return the correct list of send Handlers.

It had only one default entry for all the handlers. Also any attempt to delete the send handlers this 

way throws Error Code 0xC0C024BC

The description of the error says “The Operation is not supported”. We cannot delete a send handler via wbemtest.

Solution:

Deleting Receive Handler, Restart all the host instances or if possible restart the server and then recreate the Receive handler for the respective Adapter. This should solve the “The parameter is incorrect (WinMgmt)” issue.

If you sill see problems, the other option would be to Right click on File under Adapters list in BizTalk Admin Console and click Delete. Restart the Host Instances and then Add New Adapter -> File.

This would automatically delete the associated Receive and send Handles for FileAdapter and Recreate the default New Receive and Send Handlers.

However the only challenge in this step is it does not allow you to delete the adapter from the list of adapters when there is any receive or send ports associated and using this File Adapter.

You might need to delete those receive ports and send ports completely. Only then it will allow to delete the adapter.