What’s Your Problem?

One of the biggest problems we all face working on high side networks is figuring how to get data in and (gasp!) out.

As a system administrator, you need tools to do your job, and a lot of these tools are now delivered Just-in-Time from some internet-sourced distribution point.

Case in point – Powershell Modules!

If you’re working in the Microsoft GCC High or DOD clouds on admin workstations that are typically restricted from internet access, you know the pain.

When you try to run Install-Module, you get PackageManagement\Install-Package : No match was found for the specified search criteria and module name ‘<whatever you’re trying to load>’.

Powershell Package Not Found

Your workstation can connect to the GCC or DOD cloud endpoints through your command’s ExpressRoute or proxy settings, but you can’t connect to the CDN to actually get the administrative module you need to get your job done.

Here’s the solution – Powershell’s Save-Module!

Today I was working on a PAW on a customer’s GCC High environment, and I needed to connect to their O365 tenant.  Trying the usual Install-Module to get the Exchange V2 cmdlets on the machine, I encountered the dreaded Package not Found error.  A little bit of research, and I found a rather simple workaround.

Steps

  • From a NIPR or public cloud-connected machine, download the module you want with the following command:
Save-Module -Name ExchangeOnlineManagement -Path c:\temp

This will create a folder containing the bits for this module in C:\temp or wherever you specify.

  • Have your DTA copy the .zip file to your target environment – SIPR, JWICS, or whatever other air-gapped network you’re working on.  I’ve used DOTS with limited success, but quite often the filetypes get blocked and it’s easier to find somebody locally who can transfer the files low-to-high for you.
  • Copy this folder to C:\Program Files\WindowsPowershell\Modules\<module name>
  • In your Powershell environment, Import-Module <module name>
PS C:\Windows\system32> Import-Module exchangeonlinemanagement; get-module exchangeonlinemanagement
  • Viola, module installed on your air-gapped machine!
Connect-ExchangeOnline -ExchangeEnvironmentName O365USGovGCCHigh -UserPrincipalName mickey.mouse@disney.high.gov

ModuleType Version Name ExportedCommands
———- ——- —- —————-
Script 2.0.4 ExchangeOnlineManagement {Get-EXOCasMailbox, Get-EXOMailbox, Get-EXOMailboxFolderPermission, Get-EXOMailboxFolderStatistics…}