PowerShell Script to Query Wireless Modem and pull Asset Information.

By | February 3, 2014

Pulling a Wireless WAN Modem’s information while in the field is a daunting task. Here is a script to pull this information using AT commands with in a PowerShell script. The script was tested on a CF-53J Toughbook laptop with an embedded Sierra 7750 (Verizon LTE) modem. The script displays methods of capturing the information to a text file or writing the information to the registry.

QueryWANModem.ps1 – GitHub Link:




4 thoughts on “PowerShell Script to Query Wireless Modem and pull Asset Information.

  1. James

    Forgive me but my powershell script knowledge is terribly lacking. I’m trying to use the scrip that you have posted above, however when I try to run it, I’m returned with an error at this line:
    If (!($sRegExp -eq “”)) {$tVar -Match $sRegExp|Out-Null; $tVar = $Matches[0]}
    return $tVar

    The error is advising that it “Cannot Index into a Null Array”
    Just wondering if you came across this problem at all when you were testing, and if so, have you been able to resolve it.

    1. Brian Gonzalez Post author

      You might be better off these days using the following command line tool too grab information on the connection:

      netsh mbn show interfaces

      netsh mbn commandline.


    2. Darren

      The ‘cannot index into a null array’ error refers to the regular expression not matching anything in the reply. A possible reason is due to the local phone number not having 11 digits for example. To resolve: either change the regular expression to something that will match or just pass “”, e.g.

      $sMEID = fQueryModem “+CGSN” “\d{15}”
      $sMEID = fQueryModem “+CGSN” “”


Leave a Reply

Your email address will not be published. Required fields are marked *