I get System.Net.WebException: The request failed with HTTP status 401: Unauthorized. when I try to set up a new user in exchange 2010

taphope used Ask the Experts™
Our exchange 2010 is set to “force” the automatic propagation of settings into the user profile, including the checkbox for “Connect to Microsoft Exchange using HTTP” and filling the information for the HTTP proxy and authentication methods.  I ran this yesterday to stop that

Get-outlookprovider –identity EXPR | remove-outlookprovider

Then I recycled the app pool in iis

Now when I add a user I get this

The cmdlet extension agent with the index 0 has thrown an exception in OnComplete(). The exception is: System.Net.WebException: The request failed with HTTP status 401: Unauthorized.
   at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at Microsoft.Exchange.SoapWebClient.CustomSoapHttpClientProtocol.<>c__DisplayClass4.<Invoke>b__3()
   at Microsoft.Exchange.SoapWebClient.HttpAuthenticator.NetworkServiceHttpAuthenticator.AuthenticateAndExecute[T](SoapHttpClientProtocol client, AuthenticateAndExecuteHandler`1 handler)
   at Microsoft.Exchange.SoapWebClient.SoapHttpClientAuthenticator.AuthenticateAndExecute[T](SoapHttpClientProtocol client, AuthenticateAndExecuteHandler`1 handler)
   at Microsoft.Exchange.SoapWebClient.EWS.ExchangeServiceBinding.FindFolder(FindFolderType FindFolder1)
   at Microsoft.Exchange.ProvisioningAgent.MailboxLoggerFactory.EwsMailer.GetAdminAuditLogsFolder(ADUser adUser)
   at Microsoft.Exchange.ProvisioningAgent.MailboxLoggerFactory.EwsMailer..ctor(OrganizationId organizationId, ADUser adUser, ExchangePrincipal principal)
   at Microsoft.Exchange.ProvisioningAgent.MailboxLoggerFactory.Create(OrganizationId organizationId, ADUser mailbox, ExchangePrincipal principal)
   at Microsoft.Exchange.ProvisioningAgent.AdminLogAgentClassFactory.ConfigWrapper.get_MailboxLogger()
   at Microsoft.Exchange.ProvisioningAgent.AdminLogProvisioningHandler.OnComplete(Boolean succeeded, Exception e)
   at Microsoft.Exchange.Provisioning.ProvisioningLayer.OnComplete(Task task, Boolean succeeded, Exception exception)

Any help would be appreciated.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
remove-outlookprovider is the current part of your troubleshooting correct?

Did you tried removing the same from ADSIEDIT.msc
CN=Outlook,cn=autodiscover,cn=client access, cn=first organization,cn=microsoft exchange,cn=services,cn=configuration,dc=xxx,dc=com


I was running it as per this recommendation for that reason.


Afterward when I add a user I get this message.  It adds the user but  I'm trying to understand what the error messages is telling me and how to fix it.  
Hmm...how are you adding the user-account (mailbox?) at the console correct?

>> can you try and do the same at the exchange-powershell? does it make any difference?
Can you run the same create command with the -verbose switch?

>> Inspite of this error,  by any chance do we get the user-account, mailbox created?

>> You could also do an IISRESET and then recycle all of the exchange-service.


Ah....I have not tried to add a user with the shell  will try Monday morning.....And yes despite the error the user mailbox does get created.  what would IISRESET and then recycle all of the exchange-service.
do and how would I do it.

Do you have a clue as to what the error means?

Normally in the first line of the error message  @ "cmdlet extension agent " i would expect the description\name of some agent ...which would add some clue on this error.

As of now some agent is expecting some value and getting an 401-Unauthorized error.

Details about the "cmdlet extension agent"
Understanding Cmdlet Extension Agents

>> Just double check if the user-account created can access Outlook, OOF,free/busy...since doubting about the EWS options and some\any other attributes couldn't be configured @ the user-account\mailbox properties

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial