Managing Clients via Office365 POSH Management Shell

This forum is used to document the operation and use of the office 365 for Automate plugin. Please keep comments to a minimum inside this forum. If you have a particular issue, post that issue in the main office365 forum.
Post Reply
User avatar
Cubert
Posts: 2430
Joined: Tue Dec 29, 2015 7:57 pm
8
Contact:

Managing Clients via Office365 POSH Management Shell

Post by Cubert »

Using Office365 for Automate's Office365 POSH Management Shell

You can manage the Office365 services directly through the Office365 POSH Management Shell inside the plugin for any client under your management and control. All modules needed should automatically install when you launch the console and the client selected will become the target tenant


Using the Client selector load the client you would like to manage via PowerShell.

clientselector.PNG
clientselector.PNG (6.67 KiB) Viewed 3826 times


Select the Open Shell button next to the client selector to launch the Office365 POSH Management Shell. The following window will open and start to load everything you will need to manage Office365.com


POSH_Console.PNG
POSH_Console.PNG (63.7 KiB) Viewed 3560 times
(We will remove banner in next few releases, giving people notice for the short term to changes in exchange cmdlets)


The shell will automatically load (and install if needed) the MSOnline, Exchange and SharePoint modules before opening a session with Microsoft Online. Once the window has stopped loading you can use it to call any function or operation available in the loaded modules. If you are a PowerShell-Nut then you will like the easy of access to the POSH terminal.

User avatar
Cubert
Posts: 2430
Joined: Tue Dec 29, 2015 7:57 pm
8
Contact:

Re: Managing Clients via Office365 POSH Management Shell

Post by Cubert »

Some issues you may find based on environments, OS levels and PowerShell versions.

Issue #1
Make sure the User you have as admin in your Office365 configuration is also an admin for SharePoint.

To assign a user the SharePoint admin role, see Assign admin roles or Assign admin roles to Microsoft 365 user accounts with PowerShell.


Issue #2
Modules not auto installing as they should. You can manuall install the modules quickly on any agent by:

Open an elevated Windows PowerShell command prompt (run Windows PowerShell as an administrator).

To Manually install SharePoint Powershell Modules (As Admin)
Install-Module -Name Microsoft.Online.SharePoint.PowerShell

To Manually install SharePoint Powershell Modules (As normal user)
Install-Module -Name Microsoft.Online.SharePoint.PowerShell -Scope CurrentUser

To Manually Install MSOnline Modules (As Admin)
Run the Install-Module MSOnline command.
If you're prompted to install the NuGet provider, type Y and press Enter.
If you're prompted to install the module from PSGallery, type Y and press Enter.


Issue #3
You must use a 64-bit version of Windows. Support for the 32-bit version of the Microsoft Azure Active Directory Module for Windows PowerShell ended in 2014.

You can use the following versions of Windows as collectors and when launching the POSH console:

Windows 10, Windows 8.1, Windows 8, or Windows 7 Service Pack 1 (SP1)

Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012, or Windows Server 2008 R2 SP1


PowerShell
For the Microsoft Azure Active Directory Module for Windows PowerShell module, you must use PowerShell version 5.1 or later, up to PowerShell version 6. You can't use PowerShell version 7.

User avatar
Cubert
Posts: 2430
Joined: Tue Dec 29, 2015 7:57 pm
8
Contact:

Re: Managing Clients via Office365 POSH Management Shell

Post by Cubert »

We have upgraded to Exchange PowerShell Module EXOv2.

Any console command for exchange must come from EXO2 syntax.

Code: Select all

EXO V2 module cmdlet	                      Older related cmdlet
Get-EXOMailbox	                              Get-Mailbox
Get-EXORecipient                                 Get-Recipient
Get-EXOCasMailbox                             Get-CASMailbox
Get-EXOMailboxPermission	              Get-MailboxPermission
Get-EXORecipientPermission	              Get-RecipientPermission
Get-EXOMailboxStatistics	              Get-MailboxStatistics
Get-EXOMailboxFolderStatistics	      Get-MailboxFolderStatistics
Get-EXOMailboxFolderPermission	      Get-MailboxFolderPermission
Get-EXOMobileDeviceStatistics	      Get-MobileDeviceStatistics

User avatar
Cubert
Posts: 2430
Joined: Tue Dec 29, 2015 7:57 pm
8
Contact:

Re: Managing Clients via Office365 POSH Management Shell

Post by Cubert »

If modules are failing to load, try running the Control Center as Admin once. Log in as yourself and retry POSH office365 console. It should as a result of running as admin run the POSH as admin as well.


See if Modules install.

If so they should be available when you run in normal mode.

Post Reply

Return to “Office365 For Automate Documentation Forum”