Obtain Target List computers via PowerShell?
I'm a programmer looking to help our PDQ admins with some PDQDeploy scripted installs in PowerShell. I don't have access to our PDQ myself right now, and the docs don't always seem to have full info on the command line possibilities for PDQDeploy.exe and PDQInventory.exe. They do say that "PDQDeploy Deploy -Targets <computer names>..." can only take a raw list of computer names, so there is no way to specify a Target List or Collection.
For collections, it looks like you could get this list of computer names from the collection via PDQInventory GetCollectionComputers and do this:
$targets = PDQInventory GetCollectionComputers -Target "OurCollection"
PDQDeploy Deploy -Targets $targets -Package "OurPackage"
But there doesn't seem to be a similar way of getting the computers from a Target List? PDQDeploy.exe has GetPackageNames and GetSchedules options, but nothing that would seem to get the contents of a Target List, like:
# there seems to be no way to do something like this?
$targets = PDQDeploy GetTargetListComputers -TargetList "OurTargetList"
Am I missing something, or is this just not possible?
Comments
You are correct. PDQDeploy.exe does not have a command to retrieve members of a Target List. I recommend creating a Schedule with the desired Target List and starting it with StartSchedule.
But a Schedule is a predetermined combination of package(s) and targets (at best, the targets are dynamically calculated from a static list of Target Lists, AD groups etc)? We are trying to take a package of our choosing, and deploy it to a list of targets that we build. The targets from a Target List may only be part of the target list we build.
It is a shame that there is no such GetTargetListComputers - it seems very symmetric to GetCollectionComputers, and there's no architectural reason or anything preventing a putative command like this from doing the calculation of the targets and returning a flat list in same way?
Even an additional "-TargetList" option to "PDQDeploy Deploy" would be helpful, to deploy against a Target List instead of a list of names.
Out of curiosity, can a PowerShell Step in a deploy package (which runs on the target computer) request package deploys? Can the Step's script do anything like "PDQDeploy Deploy -Package "AnotherPackage"" to request a package be deployed to itself?
In that case, I'd recommend avoiding Target Lists altogether and only using Collections.
PDQ just never wrote a command for it. It should absolutely be possible, but they already have a lot of their plate.
Not natively. You'd have to do something like this: https://www.pdq.com/blog/mdt-imaging-in-pdq-deploy/
I guess from my limited exposure to PDQ (mainly the docs) I'd been thinking of collections as lists filtered on things like apps installed, etc. But I see there is a Static Collection which looks like it could just be an arbitrary list of computers, so that's effectively a Target List, and that may be an okay workaround. Thanks.