Forum Discussion
JasonPPF
Jan 09, 2025Copper Contributor
Internal Server Error when Setting Mailbox properties
I have a Power shell script to setting Mailbox properties below
Notes, Mail Tip, Seniority Index, etc
It always run good, but today shows the error below
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
You want to perform this operation?
User ID: "MB001.onmicrosoft.com"
Y(Yes)
You want to perform this operation?
User ID: "MB001.onmicrosoft.com"
Y(Yes)
MB001.onmicrosoft.com Resource setting completed.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
You want to perform this operation?
User ID: "MB002.onmicrosoft.com"
Y(Yes)
You want to perform this operation?
User ID: "MB002.onmicrosoft.com"
Y(Yes)
MB002.onmicrosoft.com Resource setting completed.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
loop..........
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Then I check all the Mailbox properties, the all settings is correct looks no problem.
What kind of error could be possible?
Is there any solutions?
Any information will be appreciated!
- LainRobertsonSilver Contributor
Hi Jason,
You haven't provided a sample from your script, so we have no idea at all what's going on.
I don't see any errors in your example output. Rather, those bear a strong resemblance to confirmation messages you find in many commandlets.
Many commandlets that use confirmation prompts - such as those shown above - by default properly respond to including the "-Confirm:$false" parameter, however, others make use of the "-Force" parameter instead.
- Does your command currently feature the parameter "-Confirm:$true"? If so, remove it;
- Have you tried adding the Confirm parameter? For example "Set-Mailbox -Identity ... -Confirm:$false";
- If "-Confirm:$false" didn't help, have you tried adding the "-Force" parameter? For example "Set-Mailbox -Identity ... -Force".
Note: I've chosen the "Set-Mailbox" commandlet for illustrative purposes only.
If you can provide an example of the commandlet for which the above prompting is occurring, we can provide more specific advice. But and the absence of anything to work with, the above generic guidance is all I can offer for now.
If you can also provide clarity on whether this is for Exchange Server or Exchange Online, that'd be useful for us to know.
Cheers,
Lain
- JasonPPFCopper Contributor
Hi, Lain,
Thank you for your replied!
Sorry, the script is company's stuff, so I don't have right to show it.
But I checked the all properties again, and find out "ResourceList" setting is missed.And "Set-Mailbox" again, still shows same error.
About "ResourceList" code in script is:
#Excist check
Get-DistributionGroup -Identity $strResourceList -RecipientTypeDetails RoomList 2>&1#ResourceList setting
Add-DistributionGroupMember -Identity $strResourceList -Member $strUPNRight now the confirm parameter is "Set-Mailbox -Identity ... -Confirm:$false
Never tried "-Force" parameter yet.
Error message:(Invoke-WebRequest): "{"error":{"code":"InternalServerError","message":"Error executing cmdlet","details":[{"code":"Client","target":"","message":"{¥"Properties¥":{¥"message¥":{¥"Value¥":¥"'................
Sorry replied late, and thank you for replied!