Home
%3CLINGO-SUB%20id%3D%22lingo-sub-1002321%22%20slang%3D%22en-US%22%3ERe%3A%20Updated%3A%20Running%20PowerShell%20cmdlets%20for%20large%20numbers%20of%20users%20in%20Office%20365%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1002321%22%20slang%3D%22en-US%22%3E%3CP%3EThis%20is%20great%2C%20thank%20you!%20I%20had%20just%20worked%20to%20modify%20the%20existing%20one%20to%20use%20the%20MFA%20version%2C%20and%20it%20was%20working%20well%20but%20this%20will%20be%20even%20better.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1009620%22%20slang%3D%22en-US%22%3ERe%3A%20Updated%3A%20Running%20PowerShell%20cmdlets%20for%20large%20numbers%20of%20users%20in%20Office%20365%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1009620%22%20slang%3D%22en-US%22%3E%3CP%3EShould%26nbsp%3B%3CSPAN%3E%22Then%20ensures%20that%20the%20it%20can%20continue%20running%20without%20needing%20to%20further%20prompt%20the%20user%20for%20the%20MFA%20response.%22%20Actually%20be%20%22This%20ensures%20that%20the%20it%20can%20continue%20running%20without%20needing%20to%20further%20prompt%20the%20user%20for%20the%20MFA%20response.%22%20%3F%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1000628%22%20slang%3D%22en-US%22%3EUpdated%3A%20Running%20PowerShell%20cmdlets%20for%20large%20numbers%20of%20users%20in%20Office%20365%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1000628%22%20slang%3D%22en-US%22%3E%3CP%3EBack%20in%202015%20I%20developed%20a%20PowerShell%20script%20%3CA%20href%3D%22https%3A%2F%2Fblogs.technet.microsoft.com%2Fexchange%2F2015%2F11%2F02%2Frunning-powershell-cmdlets-for-large-numbers-of-users-in-office-365%2F%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%20target%3D%22_blank%22%3EStart-RobustCloudCommand.ps1%3C%2FA%3E%20to%20help%20Exchange%20Admins%20that%20were%20moving%20to%20Exchange%20Online%20and%20were%20used%20to%20running%20commands%20against%20large%20numbers%20of%20users%20at%20once.%26nbsp%3B%20The%20script%20has%20been%20a%20success%20with%20lots%20of%20positive%20feedback%20from%20customers%20who%20have%20used%20it%20to%20successfully%20run%20expensive%20operations%20against%20very%20large%20user%20sets.%3C%2FP%3E%3CP%3EToday%20I%20am%20happy%20to%20announce%20that%20Start-RobustCloudCommand%20is%20moving%20from%20a%20PS%20script%20to%20a%20PowerShell%20module.%26nbsp%3B%20The%20new%20RobustCloudCommand%20module%20will%20be%20easier%20to%20install%20and%20use.%26nbsp%3B%20It%20also%20includes%20support%20for%20accounts%20that%20are%20MFA%20enabled.%3C%2FP%3ENew%20Features%3A%20PowerShell%20module%20%3CA%20href%3D%22https%3A%2F%2Fwww.powershellgallery.com%2Fpackages%2FRobustCloudCommand%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%20target%3D%22_blank%22%3ERobustCloudCommand%3C%2FA%3E%20that%20can%20be%20installed%20using%20the%20built%20in%20Install-Module%20command.%20Support%20for%20MFA%20enabled%20accounts.%20Automatically%20renews%20token%20for%20as%20long%20as%20the%20window%20is%20running%2C%20and%20the%20refresh%20token%20is%20valid.%20Run%20Start-RobusCloudCommand%20without%20%E2%80%9C-Credential%E2%80%9D%20to%20use%20with%20an%20MFA%20account%20Still%20supports%20Legacy%20Authentication%20using%20%E2%80%9C-Credential%E2%80%9D%20for%20situations%20where%20it%20is%20being%20used%20by%20a%20task%20or%20other%20instance%20without%20MFA.%20Source%20is%20now%20maintained%20on%20a%20public%20GitHub%20RobusCloudCommand%20with%20the%20MIT%20License.%3CP%3EThe%20current%20implementation%20using%20ADAL%20v3%20leverages%20the%20ADAL%20Dlls%20from%20the%20AzureAD%20module%20to%20call%20the%20proper%20.Net%20command%20to%20get%20an%20access%20token%20for%20the%20user%20and%20EXO%20PowerShell%20connections.%26nbsp%3B%20After%20the%20initial%20token%20is%20gathered%20when%20Start-RobustCloudCommand%20rebuilds%20the%20correct%20at%2015-minute%20interval%20it%20will%20use%20the%20Refresh%20Token%20to%20pull%20a%20new%20Access%20Token.%26nbsp%3B%20Then%20ensures%20that%20the%20it%20can%20continue%20running%20without%20needing%20to%20further%20prompt%20the%20user%20for%20the%20MFA%20response.%3C%2FP%3E%3CP%3ESince%20the%20connection%20code%20involved%20here%20might%20be%20useful%20to%20other%20people%20writing%20scripts%20I%20broke%20it%20out%20into%20a%20separate%20PowerShell%20module%20%3CA%20href%3D%22https%3A%2F%2Fwww.powershellgallery.com%2Fpackages%2FCloudConnect%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%20target%3D%22_blank%22%3ECloudConnect%3C%2FA%3E.%26nbsp%3B%20That%20module%20is%20also%20on%20GitHub%20and%20I%20intend%20to%20expand%20it%20further%20to%20offer%20support%20for%20connecting%20to%20other%20O365%20PowerShell%20Endpoints%20in%20an%20enhanced%20manner.%3C%2FP%3E%3CP%3EPlease%20feel%20free%20to%20provide%20feedback%20on%20any%20problems%20that%20are%20encountered%20or%20if%20there%20is%20a%20feature%20that%20you%20would%20love%20to%20see%20added%20to%20either%20of%20these%20modules%20going%20forward.%3C%2FP%3E%3CP%3EMatthew%20Byrd%3CBR%20%2F%3EEscalation%20Engineer%2C%20Microsoft%20Exchange%20Support%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1000628%22%20slang%3D%22en-US%22%3E%3CP%3EBack%20in%202015%2C%20I%20developed%20a%20PowerShell%20script%20Start-RobustCloudCommand.ps1%20to%20help%20Exchange%20Admins%20that%20were%20moving%20to%20Exchange%20Online%20and%20were%20used%20to%20running%20commands%20against%20large%20numbers%20of%20users%20at%20once.%20The%20script%20has%20been%20a%20success%20with%20lots%20of%20positive%20feedback%20from%20customers%20who%20have%20used%20it%20to%20successfully%20run%20expensive%20operations%20against%20very%20large%20user%20sets.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1000628%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAnnouncements%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EScripting%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ETroubleshooting%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1040831%22%20slang%3D%22en-US%22%3ERe%3A%20Updated%3A%20Running%20PowerShell%20cmdlets%20for%20large%20numbers%20of%20users%20in%20Office%20365%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1040831%22%20slang%3D%22en-US%22%3E.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1063829%22%20slang%3D%22en-US%22%3ERe%3A%20Updated%3A%20Running%20PowerShell%20cmdlets%20for%20large%20numbers%20of%20users%20in%20Office%20365%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1063829%22%20slang%3D%22en-US%22%3E%3CP%3EFantastic%2C%20I've%20been%20struggling%20to%20update%20permissions%20on%20a%20large%20number%20of%20O365%20public%20folders%20via%20EXOPS%2C%20and%20I%20think%20this%20will%20do%20the%20trick.%3C%2FP%3E%3CP%3EThanks%20for%20publicizing%20it!%20I%20will%20try%20it%20out%20ASAP!%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E

Back in 2015 I developed a PowerShell script Start-RobustCloudCommand.ps1 to help Exchange Admins that were moving to Exchange Online and were used to running commands against large numbers of users at once.  The script has been a success with lots of positive feedback from customers who have used it to successfully run expensive operations against very large user sets.

Today I am happy to announce that Start-RobustCloudCommand is moving from a PS script to a PowerShell module.  The new RobustCloudCommand module will be easier to install and use.  It also includes support for accounts that are MFA enabled.

New Features:

  • PowerShell module RobustCloudCommand that can be installed using the built in Install-Module command.
  • Support for MFA enabled accounts.
    • Automatically renews token for as long as the window is running, and the refresh token is valid.
    • Run Start-RobusCloudCommand without “-Credential” to use with an MFA account
  • Still supports Legacy Authentication using “-Credential” for situations where it is being used by a task or other instance without MFA.
  • Source is now maintained on a public GitHub RobusCloudCommand with the MIT License.

The current implementation using ADAL v3 leverages the ADAL Dlls from the AzureAD module to call the proper .Net command to get an access token for the user and EXO PowerShell connections.  After the initial token is gathered when Start-RobustCloudCommand rebuilds the correct at 15-minute interval it will use the Refresh Token to pull a new Access Token.  Then ensures that the it can continue running without needing to further prompt the user for the MFA response.

Since the connection code involved here might be useful to other people writing scripts I broke it out into a separate PowerShell module CloudConnect.  That module is also on GitHub and I intend to expand it further to offer support for connecting to other O365 PowerShell Endpoints in an enhanced manner.

Please feel free to provide feedback on any problems that are encountered or if there is a feature that you would love to see added to either of these modules going forward.

Matthew Byrd
Escalation Engineer, Microsoft Exchange Support

4 Comments
Senior Member

This is great, thank you! I had just worked to modify the existing one to use the MFA version, and it was working well but this will be even better.

Senior Member

Should "Then ensures that the it can continue running without needing to further prompt the user for the MFA response." Actually be "This ensures that the it can continue running without needing to further prompt the user for the MFA response." ?

Frequent Visitor
.
Occasional Visitor

Fantastic, I've been struggling to update permissions on a large number of O365 public folders via EXOPS, and I think this will do the trick.

Thanks for publicizing it! I will try it out ASAP!