Very cool...thanks for sharing! Do you have this posted on the net somewhere?
-Phil From: [email protected] [mailto:[email protected]] On Behalf Of Jimmy Martin Sent: Thursday, April 10, 2014 5:11 PM To: [email protected] Subject: [mssms] OSD Dynamic application discovery finding information even though pre-execute powershell ran Just in case anyone has noticed this in your environment... I have a task sequence for windows 7 I am supplying to migrators on bootable usb media. The media is set to run a pre-execute powershell script to give the migrator the ability to delete pre-existing computer accounts from CM so they can see the win7 deployment to the unknown computer collection. The powershell is at least partially taken from code found on the internet used in a popular powershell front end. The code correctly discovers computer accounts in the CM db so I can tell the discovery works and connectivity exists to CM DB. If you select to delete the computer account, it will then give you the opportunity to select the unknown computer win7 deployment AND the deployment will continue to completion. *BUT*, what I have seen is that my customsettings.ini, which has both MDT mapping and dynamic app mapping sections (in support of the same task sequence being used in multiple ways), is discovering apps for both MDT roles/packages and Dynamic) which should be impossible *IF* the delete is working as it should. Right? Well, the deal is that the stored procedure used to discover dynamic applications which is detailed on several different web sites if you search for dynamic application installation via sccm with mdt package mapping does not have the sccm discovery information as a component of the app discovery query... so, this means the dynamic app retrieval may indeed pull app information although the discovery information was deleted by the powershell... Just in case someone ever noticed that and wondered why... My updated MDT stored procedure looks like this and I have tested and it works like a charm: USE [mdt] GO /****** Object: StoredProcedure [dbo].[RetrievePackages] Script Date: 4/10/2014 4:06:48 PM ******/ SET ANSI_NULLS OFF GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[RetrievePackages] @MacAddress CHAR(17) AS SET NOCOUNT ON /* Select and return all the appropriate records based on current inventory */ SELECT * FROM PackageMapping WHERE ARPName IN ( SELECT distinct ARPDisplayName0 FROM CM_BMH.dbo.v_GS_INSTALLED_SOFTWARE a, CM_BMH.dbo.v_GS_NETWORK_ADAPTER n, CM_BMH.dbo.v_R_System s WHERE a.ResourceID = n.ResourceID and n.ResourceID = s.ResourceID AND n.MACAddress0 = @MacAddress ) Jimmy Martin | Engineer | Information Technology | BMHCC - CORPORATE Phone: (901) 227-8209 | [email protected]<mailto:[email protected]> Opinions expressed above are not necessarily those of Baptist. This message and any files transmitted with it may contain legally privileged, confidential, or proprietary information. If you are not the intended recipient of this message, you are not permitted to use, copy, or forward it, in whole or in part without the express consent of the sender. Please notify the sender of the error by reply email, disregard the foregoing messages, and delete it immediately. P Please consider the environment before printing this email... ________________________________ PRIVILEGED AND CONFIDENTIAL. This email and any files transmitted with it are privileged and confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the sender. If you are not the named addressee you should not disseminate, distribute or copy this e-mail or any of its attachments.

