Exchange 2010 Disable-UMMailbox works fine when typed in EMS but gives "CallDepthOverflow error" when used in code.
The issue in brief is -> When I use the commandlet "Disable-UMMailbox oct105 -Confirm:$false" in code it throws error The script failed due to call depth overflow. The call depth reached 1001 and the maximum is 1000. + CategoryInfo : InvalidOperation: (1001:Int32) [], ParentContainsErrorRecordException + FullyQualifiedErrorId : CallDepthOverflow The code has other UM related commands (like Enable-UMMailbox) which are running perfectly fine in code. Only Disable-UMmailbox has issue. This commandlet runs fine if I paste this command as it is in Exchange Mangement Shell Following are the details, I am working on Disabling UM mailboxes for the users. I am using powershell v1.0 I am running code from server "Windows Server - 64bit OS" I am running code from account which is "Exchange Org Admin" This account is also member of roles "Organization Management" , "UM Management" The commandlet runs fine if -> I open exchange management shell for exchange 2010 -> I type the commandlet Disable-UMMailbox oct105 -Confirm:$false But I want to use this in my code where there will be a logic to disable UM mail box. I am excecuting this code from Exchange Management Shell. The code in the file Test.ps1 is as follows, i.e this code file has nothing but one line of commandlet " Disable-UMMailbox oct105 -Confirm:$false " I opened the Exchange Management SHell executed ./Test.ps1 and got following error. The script failed due to call depth overflow. The call depth reached 1001 and the maximum is 1000. + CategoryInfo : InvalidOperation: (1001:Int32) [], ParentContainsErrorRecordException + FullyQualifiedErrorId : CallDepthOverflow Please Note: All other Exchange UM related commands are running fine in the real code file. Thanks in advance Hrishi
October 27th, 2010 4:27pm

Hi, Change the script to: Disable-UMMailbox oct105 -Confirm 0 What's result? Does the issue persists? Please remember to click Mark as Answer on the post that helps you, and to click Unmark as Answer if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Thanks Gen Lin-MSFT
Free Windows Admin Tool Kit Click here and download it now
November 1st, 2010 5:27am

Today I resolved this issue. I feel there were 2 reasons 1) 1st and most likely I had written was calling "Disable-UMMailbox" in one function . The function name was also given "disable-umMailbox". I think the same name of the function as of commandlet created this issue at first place. 2) I mentioned that later I tried with the script file having only one line "Disable-UMMailbox" .Still this was not working. My colleagues also got this error with that script file. I "think" this was because there was some session of EMS was always open on server from different logins. The name of the script file was same i.e Test1.ps1 so the EMS might have referenced the old file (i.e with the senario mentioned in 1st case) . Finally these are just my guesses. It suddenly started working (might be the server might have got rebooted flushing out all sessions) Thanks for the help. Thanks, Hrishi
November 5th, 2010 12:05am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics