Category Archives: Tools

Testing ConfigMgr packages & applications before adding them into ConfigMgr using PsExec.exe

To test that an application is 99.9% sure to work when deployed via ConfigMgr it is important to initially test installers by running them in the SYSTEM context on a test machine.

Applications and Packages run under the SYSTEM context when deployed via ConfigMgr and can behave differently when compared to running them as a Local Administrator account or a standard user.

Testing them with PsExec (from the Microsoft PSTools suite – part of Microsoft Sysinternals) means that you can be pretty sure that they will work once you’ve added them into ConfigMgr but saves you time before you create the package/application, distribute the content and test in a deployment etc. only to find it fails and have to start over again.

Running the command below from an ‘Administrator’ command prompt will mimic the ConfigMgr deployment by running any commands issued in the resulting Command Prompt as the LOCAL SYSTEM account:

psexec -s -i cmd.exe

You’ll know that the command prompt is running as SYSTEM by running ‘whoami’ as per the screenshot below:

Once tested in this way, you can go ahead and add your package or application into ConfigMgr and be confident that any deployments to clients via Software Distribution or Task Sequence will be successful.

/ JC

$OEM$ Alternative In MDT 2012 U1

So the $OEM$ technique of copying data from a Deployment Share to a machine being deployed is no more.

As an alternative simply use an XCOPY command in your Task Sequence as per the example below (Use a ‘Run Command Line’ step) for the CMTrace tool:

xcopy.exe "%deployroot%\Custom\CMTrace.exe" "C:\Windows\System32" /Q /H /E /I /Y
  • /Q – Does not display file names while copying.
  • /H – Copies hidden and system files also.
  • /E – Copies directories and subdirectories, including empty ones. Same as /S /E. May be used to modify /T.
  • /I – If destination does not exist and copying more than one file, assumes that destination must be a directory.
  • /Y – Suppresses prompting to confirm you want to overwrite an existing destination file.

/ JC

Testing Connectivity Over Any TCP Port

1. PowerShell Test-NetConnection

Since Windows 8.1/Server 2012 R2 you can now test/ping TCP connections over any port using PowerShell and the Test-NetConnection cmdlet.

The syntax for the command is as below. This tests if RDP (port 3389) is available/open on a server called ‘DC01‘ – you can change the hostname to an IP adress and you can use any port you like with the ‘-Port‘ switch:

Test-NetConnection DC01 -Port 3389

This should present results like the following with the key result being “TcpTestSuceeded: True” to signify that the port is indeed open:

Test-NetConnection3389

If you run “Test-NetConnection” without specifying any parameters it will perform a test to determine if the device you are running the command on has access to the internet – this can be quite useful in a number of situations. When run on a client that does have Internet access you will see results similar to this:

Test-NetConnectionInternet

2. paping.exe 

paping.exe is an invaluable tool for testing network connectivity, especially in a firewalled environment where using telnet isn’t straightforward and standard ICMP ping is blocked.

The tool basically allows you to send a “ping” over any TCP port which means that even if a firewall blocks ICMP pings, the paping.exe packet will be allowed through on a port that is open through the firewall.

A good example of this might be testing connectivity to an ConfigMgr Distribution Point where SMB (TCP port 445) has been allowed through a firewall but standard ping is blocked: simply copy the paping.exe onto the machine you wish to initiate the connectivity test from and run the following command from a command prompt:

paping.exe [target hostname or IP address] -p 445

This will send a constant ping on TCP port 445 to the hostname or IP address specified. Brilliant.

Find the download for the tool at: http://code.google.com/p/paping/

3. PsPing.exe

Alternative tool that does the same thing is PsPing from the Sysinternals Suite:

https://technet.microsoft.com/en-gb/sysinternals/jj729731

/ JC