Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Symptoms
After you install the November 2022 Microsoft Exchange Server security updates (SUs) or later SUs, you try to run Export-ModernPublicFolderStatistics.ps1, but the script fails and returns the following error message:
Method invocation failed because [System.String] does not contain a method named 'ToBytes'.
Workaround
To work around this issue, use one of the following methods.
Workaround 1
Open Export-ModernPublicFolderStatistics.ps1 in a text editor.
Search for and replace all occurrences of
ToBytes()
withToString().Split("(")[1].Split(" ")[0].Replace(",","")
.Save the modified content to a new file, such as Export-ModernPublicFolderStatistics-Temp.ps1.
Run Export-ModernPublicFolderStatistics-Temp.ps1.
Workaround 2
Open an elevated PowerShell session.
Load the Exchange Management PowerShell cmdlets by running the following command:
Add-PSSnapin *Exchange*
Run Export-ModernPublicFolderStatistics.ps1.
Status
Microsoft is investigating this issue and will update this article when more information becomes available.