Exchange Online PowerShell: Resolving error – Get-OwaMailboxPolicy: The term ‘Get-OwaMailboxPolicy’ is not recognized as a name of a cmdlet, function, script file, or executable program

Exchange Online PowerShell CMDLET - "Get-OwaMailboxPolicy"
Exchange Online PowerShell CMDLET - "Get-OwaMailboxPolicy"

Hi All,

Greetings for the day!

Today new issue and resolution 🙂

Details

  • I want to see the mail box policies in my tenant
  • To get the Outlook web mail box policies I am using Exchange PowerShell – Get-OwaMailboxPolicy
  • While executing the “Get-OwaMailboxPolicy” PowerShell CMDLET I am getting an error

Error / Issue

Get-OwaMailboxPolicy: The term ‘Get-OwaMailboxPolicy’ is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

PowerShell terminal displaying an error message indicating the cmdlet 'Get-OwaMailboxPolicy' is not recognized.
figure: Exchange Online PowerShell CMDLET – “Get-OwaMailboxPolicy”

Solution

  • Make sure “ExchangeOnlineManagement” PowerShell module is installed.
  • We can make sure by executing the CMDLET – Get-Module as

PS C:\> Get-Module -Name ExchangeOnlineManagement -ListAvailable

    Directory: C:\Users\u1086350\Documents\PowerShell\Modules

ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Script     3.8.0                 ExchangeOnlineManagement            Desk      {Add-VivaModuleFeaturePolicy, Add-VivaO…

PowerShell window showing the command 'Get-Module -Name ExchangeOnlineManagement -ListAvailable' being executed, along with the output listing the version and details of the ExchangeOnlineManagement module.
figure: Executing PowerShell CMDLET – Verifying if “Exchange Online” PowerShell module is installed or not
  • If “Exchange Online” PowerShell module is not installed, we can install “Exchange Online” PowerShell module by executing “Install-Module” PowerShell CMDLET as

Install-Module -Name ExchangeOnlineManagement -Force

  • Once we have successfully installed PowerShell module “ExchangeOnlineManagement“, try importing the module using “Import-Module” PowerShell CMDLET

Import-Module -Name ExchangeOnlineManagement -Force

  • As we install and import “Exchange Online” PowerShell module successfully, make sure we are connecting to “Exchange Online” by executing the PowerShell CMDLET – “Connect-ExchangeOnline”

Connect-ExchangeOnline

PowerShell window displaying the 'Connect-ExchangeOnline' command with instructions and descriptions about the new Exchange Online module.
figure: Connecting to Exchange Online – Connect-ExchangeOnline

  • After successfully connecting to “Exchange Online“, we are successfully capable of executing the “Get-OwaMailboxPolicy” cmdlet

PS C:\> Get-OwaMailboxPolicy

WacEditingEnabled                                    : True
PrintWithoutDownloadEnabled                          : True
OneDriveAttachmentsEnabled                           : True
ThirdPartyFileProvidersEnabled                       : False
AdditionalStorageProvidersAvailable                  : True
ClassicAttachmentsEnabled                            : True
ReferenceAttachmentsEnabled                          : True
SaveAttachmentsToCloudEnabled                        : True
InternalSPMySiteHostURL                              :
ExternalSPMySiteHostURL                              :
ExternalImageProxyEnabled                            : True
NpsSurveysEnabled                                    : True
MessagePreviewsDisabled                              : False
PersonalAccountCalendarsEnabled                      : True
TeamsnapCalendarsEnabled                             : True
BookingsMailboxCreationEnabled                       : True
BookingsMailboxDomain                                :
ProjectMocaEnabled                                   : False
DirectFileAccessOnPublicComputersEnabled             : True
DirectFileAccessOnPrivateComputersEnabled            : True
WebReadyDocumentViewingOnPublicComputersEnabled      : True
WebReadyDocumentViewingOnPrivateComputersEnabled     : True
ForceWebReadyDocumentViewingFirstOnPublicComputers   : False
ForceWebReadyDocumentViewingFirstOnPrivateComputers  : False
WacViewingOnPublicComputersEnabled                   : True
WacViewingOnPrivateComputersEnabled                  : True
ForceWacViewingFirstOnPublicComputers                : False
ForceWacViewingFirstOnPrivateComputers               : False
ActionForUnknownFileAndMIMETypes                     : Allow
WebReadyFileTypes                                    : {.xlsx, .pptx, .docx, .xls…}
WebReadyMimeTypes                                    : {application/vnd.openxmlformats-officedocument.presentationml.pr
                                                       esentation, application/vnd.openxmlformats-officedocument.wordpr
                                                       ocessingml.document, application/vnd.openxmlformats-officedocume
                                                       nt.spreadsheetml.sheet, application/vnd.ms-powerpoint…}
WebReadyDocumentViewingForAllSupportedTypes          : True
WebReadyDocumentViewingSupportedMimeTypes            : {application/msword, application/vnd.ms-excel,
                                                       application/x-msexcel, application/vnd.ms-powerpoint…}
WebReadyDocumentViewingSupportedFileTypes            : {.doc, .dot, .rtf, .xls…}
AllowedFileTypes                                     : {.rpmsg, .xlsx, .xlsm, .xlsb…}
AllowedMimeTypes                                     : {image/jpeg, image/png, image/gif, image/bmp}
ForceSaveFileTypes                                   : {.vsmacros, .ps2xml, .ps1xml, .mshxml…}
ForceSaveMimeTypes                                   : {Application/x-shockwave-flash, Application/octet-stream,
                                                       Application/futuresplash, Application/x-director…}

PowerShell command execution showing OwaMailboxPolicy settings including various enabled features.
figure: “Get-OwaMailboxPolicy” PowerShell CMDLET executed successfully

REFERENCES

Thanks for reading!!!

HAVE A FANTASTIC TIME AHEAD !!! LIFE IS BEAUTIFUL 🙂

Prasham Sabadra

LIFE IS VERY BEAUTIFUL. ENJOY THE WHOLE JOURNEY :) Founder of Microsoft 365 Junction, Speaker, Author, Learner, Developer, Passionate Techie. Certified Professional Workshop Facilitator / Public Speaker. Believe in knowledge sharing. Around 20+ years of total IT experience and 17+ years of experience in SharePoint and Microsoft 365 services Please feel free me to contact for any SharePoint / Microsoft 365 queries. I am also very much interested in behavioral (life changing) sessions like motivational speeches, Success, Goal Setting, About Life, How to live Life etc. My book - Microsoft 365 Power Shell hand book for Administrators and Beginners and 100 Power Shell Interview Questions - https://www.amazon.in/Microsoft-Administrators-Beginners-Interview-Questions/dp/9394901639/ref=tmm_pap_swatch_0?_encoding=UTF8&qid=1679029081&sr=8-11

You may also like...

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.