Remove Deployments from Computers

From the 6/29/17 webcast, this tool will remove deployments from a computer in Inventory where the OSInstall Date is is AFTER the Deployment date. This is useful if you have a machine you've reimaged.

 

<?xml version="1.0" encoding="utf-8"?>
<AdminArsenal.Export Code="PDQInventory" Name="PDQ Inventory" Version="13.0.2.0" MinimumVersion="11.0">
<CustomTool>
<CommandLine>"DELETE FROM PDQDeployments WHERE ComputerId IN (SELECT ComputerId FROM computers WHERE EndTime &lt; OSInstallDate);" | sqlite3.exe "$env:PROGRAMDATA\Admin Arsendal\PDQ Inventory\Database.db"</CommandLine>
<DefaultIconKey></DefaultIconKey>
<IsSystemWide value="true" />
<LibraryToolId value="null" />
<Modified value="null" />
<ShellOpenMode>CloseShell</ShellOpenMode>
<ShellType>PowerShell</ShellType>
<Description></Description>
<IconKey>Icon-PowerShell</IconKey>
<KeyGesture></KeyGesture>
<Title>Remove Deployments for Computer</Title>
<TypeName>CustomTool</TypeName>
</CustomTool>
</AdminArsenal.Export>
0

Comments

1 comment
Date Votes
  • Thank you! For anyone else using this, there's one tiny typo for the database path:

    "$env:PROGRAMDATA\Admin Arsendal\PDQ Inventory\Database.db

    For easy copypasting:

    <?xml version="1.0" encoding="utf-8"?>
    <AdminArsenal.Export Code="PDQInventory" Name="PDQ Inventory" Version="12.4.0.5" MinimumVersion="11.0">
    <CustomTool>
    <CommandLine>"DELETE FROM PDQDeployments WHERE ComputerId IN (SELECT ComputerId FROM computers WHERE EndTime &lt; OSInstallDate);" | sqlite3.exe "$env:PROGRAMDATA\Admin Arsenal\PDQ Inventory\Database.db"</CommandLine>
    <DefaultIconKey></DefaultIconKey>
    <IsSystemWide value="true" />
    <LibraryToolId value="null" />
    <Modified value="null" />
    <ShellOpenMode>LeaveShellOpen</ShellOpenMode>
    <ShellType>PowerShell</ShellType>
    <IconKey>Icon-PowerShell</IconKey>
    <KeyGesture></KeyGesture>
    <Title>Remove Deployment &gt; OS Install</Title>
    <Description></Description>
    </CustomTool>
    </AdminArsenal.Export>

     

    0

Please sign in to leave a comment.

Didn't find what you were looking for?

New post