Browse Month: May 2017

MDT – Trigger PDQ Deploy after Deployment

PDQ Deploy is an amazing tool for deploying software across the network. Wouldn’t it be handy to trigger PDQ deployments after a successful image deployment from MDT? This would allow software such as Anti-virus, Microsoft Office etc to be installed automatically straight after installation. If you are interested, read on….

Configure PDQ Deploy to use TCP

For this to work, we can take advantage of the PDQ Deploy command line tool. Firstly, we need to make a quick registry edit on the PDQ Deploy server. Create a REG_DWORD key called ServicePort in the below hive:


This key tells PDQ Deploy to use TCP for background service. Set the value to the TCP port number that you want to use (I set mine to 10649). Once that is done, close the PDQ Deploy console if it is open and restart the PDQ Deploy service for the changes to take effect. For more info, see the Admin Arsenal document here.

Creating the Powershell Script

Next, create a Powershell script in the scripts directory in your deployment share. Here is the contents of the script:

Invoke-Command -ComputerName YOUR.PDQ.SERVER -ScriptBlock { param ($compname) & 'C:\Program Files (x86)\Admin Arsenal\PDQ Deploy\pdqdeploy.exe' Deploy -Package "PACKAGE_NAME" -Targets $compname} -ArgumentList "$env:COMPUTERNAME"

Remember to replace the hostname with the DNS name or IP of your PDQ Deploy server and the package name with the name of the package that you want to deploy after OS installation. If you are using a DNS name, the MDT clients must be able to resolve this name. If you want to deploy multiple packages, create a new PDQ package with the packages you want to deploy as nested packages. This script takes advantage of PS Remoting, so we will look at how to enable this next.

Enabling PS Remoting

To enable PS Remoting, launch Powershell as an administrator on your PDQ Deploy server and run Enable-PSRemoting then go to services and set the WinRM service startup type to automatic.

Adding to the Task Sequence

Now that we have everything setup, we need to tell MDT to run the script that we created. To do this, create a new CMD Command task and type this in the command box:

powershell -executionpolicy bypass "& ""\\MyMDTServer\DeploymentShare\Scripts\PDQ-Deploy-MDT.ps1"""

Make sure you update the UNC path to point to the script on your MDT server. Make sure that you run the task with a user who has console permissions on the PDQ Deploy server. Also, you may be thinking why not use a powershell task? This is because as far as I can see, there is no option to run a Powershell task as another user.

At this point, its time to test! Your deployment share will need to be updated before testing.


See Also : MDT – Get Computer Name from PHP Script


Aerohive AP330 Won’t Bring Up Second Interface on 802.3af PoE

Just a quick post to explain something that I wish i’d found out before taking the time to troubleshoot the issue!

The Aerohive AP330 (and maybe other Aerohive APs), as a power saving measure, won’t allow the second Ethernet interface to be activated when the AP is running on 802.3af PoE (Power over Ethernet).

This is a power saving measure due to the limitations of 802.3af which can only deliver a maximum power of 12.95 watts (after cable losses). The solution to this problem is to use a 802.3at PoE injector/switch to power your APs. When I described this behaviour as an issue above, what I actually meant is that this is a smart move from Aerohive as it allows the APs to still be used with older PoE switches that only support 802.3af without limiting the functionality of the AP to most people.

Now, back to the story. I found this out after trying to clobber together a guest access solution where the guest traffic is tunnelled (via GRE) to an AP330 which was connected to two networks : The main network and a DMZ via a transparent Squid proxy. For those wondering how this worked, I tagged the guest traffic with VLAN2 (we don’t use VLANs on our main network yet) and  set a static route on the AP330 to send VLAN2 traffic through the DMZ interface.

I hope this helps others in a similar situation!



Source of PoE information :

MDT – Get Computer Name from PHP Script

The Microsoft Deployment Toolkit (MDT) is a tool that can be used to assist in the deployment of the Microsoft Windows operating system. It is usually used in conjunction with Windows Deployment Services (WDS) for enterprise image deployment via PXE (network booting). MDT is very customizable, allowing it to be adapted to suit many different environments.

In this post, I will be discussing how to use an MDT web service to get the computer name (Called the OSDComputerName in MDT) from a PHP script. This logic can be applied to many other MDT fields, but in this example I will be using the OSDComputerName. Many people who might manage smaller deployments may ask why this is useful, especially when MDT can use serial numbers and other things in the computer name. I would answer that every company is different in their computer naming convention. The ability to hand off the computer naming to PHP makes it very flexible. PHP can query databases and integrate with asset management systems to get the name for the computer being imaged. This flexibility really helps to speed up the deployment process for larger organisations.

Now that the introduction is out the way, let’s get in to it! The first step is to setup your PHP script. For this, I used an IIS web server. In the example below, I have left the section blank where you need to determine the computer name. I have included the relevant code to get the IP address of the client, should you need that for your script. You can use any logic here such as connecting to databases, using APIs or querying active directory. Also note the headers that are in place. This is because we need to return an XML file with the computer name for MDT to parse.

//set the script to output XML
header('Content-Type: text/xml');
$output = '<?xml version="1.0" encoding="utf-8" ?>';
//get the IP address of the device being imaged
//do some magic here to determine the computer name. Put it in the $computername variable
//return the computer name
$output = $output.'<string xmlns="http://myiisserver.mydomain/myscript.php">'.$computername.'</string>';
print ($output);

This script must be available over HTTP to the clients being imaged. You can test the script output by visiting the page in your web browser.

Step two is to add the web service settings to MDT. For this, we need to edit the CustomSettings.ini file in the deployment share (in the control folder). For this, I usually use Notepad++ which is a fantastic, free text editor although you could just as easily use Notepad. Add the following lines to your CustomSettings file. You need to replace the web service location to the URL of your script. Once again, make sure that this is available to your clients being imaged. If you are using a DNS name, make sure that the clients will be able to resolve the name.


The above code tells MDT that this section of the file will be using a web service. It queries the web service and assigns the result to the OSDComputerName variable. If you do not choose to skip the computer name screen in the light touch wizard then the calculated computer name will be shown in the computer name box in the wizard.

That’s it! You will need to update your deployment share, then image a PC and try it out!


Good Morning/Afternoon/Evening and welcome to my blog. My name is Brandon and I work in the IT in Education industry in the UK.

The purpose of this blog is for me to share certain things that I wish it would have been easier to find, and share my thoughts on various topics that interest me. Also, I think that writing the occasional blog post may help me to learn and memorise things, and provide me with something to look back at / search through.

In short, this is an informal place for like-minded people to find information that I found out by experimenting!

If you need help with anything I have posted, just leave a comment. I cannot promise that I can help, but I will try!

Happy reading,