Ports Status Check from the Console and / or Client - PowerShell

Version 6



    This is a tool intended to help support and Protect users to quickly check their Console / Client connectivity.  You can download the script through the link at the bottom of this article

    Getting Started


    Rights / Requirements


    • You have to run this script as an Administrator with at least Local Administrator rights.
    You have to run the script: ConsoleToClient.ps1 on a Shavlik Protect Console. You have to run the script: ClientToConsole.ps1 on a Client machine that communicates back to a console

    Execution Policy Change


    • As default Security Settings usually prevent scripts from running on a server, you may see this message:




    As this script is not altering any file or folder aside from C:\ShavlikPorts, you can safely run it by putting Yes or Y    Here is the link given by Microsoft about the Execution Policies:


    In order to check manually if your policies are authorized to run, you can type in a PowerShell window Get-ExecutionPolicy:



    You can then modify it by typing Set-ExecutionPolicy Unrestricted which will lead you to the previous prompt:



    Here is a Technet article about these commands that may be useful:


    ATTENTION: Please remember to set the Execution Policy back to its default settings when you have finished to run the script to maintain your organization's security standard


    How To Use


    You will be prompted for the IP address or the hostname of the machine you want to test.

    Then you will have to choose between the following:


    • TCP
    • UDP
    • TCP and UDP


    Here is what is scanned for each of them.


    I.  TCP


    From Console to Client - ConsoleToClient.ps1


    • The following ports are being tested with a 1800 ms timeout:


    135, 137, 138, 139, 445, 5120, 4155


    From Client to Console - ClientToConsole.ps1





    II.  UDP


    From Console to Client - ConsoleToClient.ps1


    • The following ports are being tested with a 1800 ms timeout:




    From Client to Console - ClientToConsole.ps1





    III. TCP and UDP


    • Choices 1 and 2 are both run, and ports from both are tested




    A folder is created with the IP address of the client machine as a name and will contain a TCP and/or UDP folder(s).  The results of the ports testing are sent to a text file within C:\ShavlikPorts. The text file is named after the type of port check, followed by the IP Address/Hostname of the machine tested, and the date and time the test concluded.


    This PowerShell script is not official and is not supported by Shavlik in any way.

    In no event shall Shavlik be liable for any consequential, incidental or direct damages suffered in the course of using this script.