Home
%3CLINGO-SUB%20id%3D%22lingo-sub-852052%22%20slang%3D%22en-US%22%3ERe%3A%20One%20Method%20to%20Track%20Devices%20Built%20via%20a%20Specific%20SCCM%20Task%20Sequence%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-852052%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20was%20trying%20the%20steps%20you%20mentioned%20above.%26nbsp%3B%20When%2C%20I%20try%20to%20add%20registry%20keys%20as%20a%20command%20file%20it%20is%20in%20a%20loop.%26nbsp%3B%20Not%20sure%2C%20If%2C%20I%20have%20something%20wrong%20within%20the%20CMD%20file.%26nbsp%3B%20I%20saved%20the%20file%20reg.cmd.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20was%20able%20to%20accomplish%20the%20task%20through%20PowerShell.%26nbsp%3B%20Added%20each%20registry%20entry%20individually%20and%20all%20the%20entries%20show%20up%20in%20registry%20now.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMy%20question%20is%20when%2C%20I%20create%20a%20package%20will%20my%20reg.cmd%20work%3F%26nbsp%3B%20This%20is%20what%20is%20in%20the%20reg.cmd%20file%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EREG%20ADD%20HKLM%5CSOFTWARE%5CMicrosoft%5CWindows%5CCurrentVersion%5CramlanBuildInfo1%20%2Fv%20UniqueID%20%2Ft%20REG_SZ%20%2Fd%20%22dfeee803-daf6-4d65-8c7d-832c3e56c04b%22%20%2Ff%3C%2FP%3E%3CP%3EREG%20ADD%20HKLM%5CSOFTWARE%5CMicrosoft%5CWindows%5CCurrentVersion%5CramlanBuildInfo1%20%2Fv%20date%20%2Fd%20%22%25DATE%25%22%20%2Ft%20REG_EXPAND_SZ%20%2Ff%3C%2FP%3E%3CP%3EREG%20ADD%20HKLM%5CSOFTWARE%5CMicrosoft%5CWindows%5CCurrentVersion%5CramlanBuildInfo1%20%2Fv%20time%20%2Fd%20%22%25TIME%25%22%20%2Ft%20REG_EXPAND_SZ%20%2Ff%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-850259%22%20slang%3D%22en-US%22%3EOne%20Method%20to%20Track%20Devices%20Built%20via%20a%20Specific%20SCCM%20Task%20Sequence%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-850259%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20All%2C%20my%20name%20is%20Deepika%20and%20I%E2%80%99m%20a%20Premier%20Field%20Engineer%20with%20Microsoft%20India.%20I%20would%20like%20to%20share%20one%20of%20the%20methods%20to%20identify%20devices%20which%20are%20built%20via%20SCCM.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EImagine%20a%20scenario%20where%20machines%20are%20re-imaged%5Cbuilt%20at%20different%20geographical%20locations%20by%20using%20multiple%20Task%20sequences%20each%20with%20different%20TS%20steps%20and%20with%20different%20Operating%20systems%20Images%20referenced%20in%20it.%20To%20find%20which%20machines%20was%20built%20using%20which%20OS%20image%20will%20be%20a%20tough%20task%20unless%20we%20have%20some%20unique%20value%5Csetting%20available%20to%20differentiate%20in%20these%20images.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHere%20is%20one%20instance%20I%20encountered%20where%20an%20organization%20had%20many%20methods%20of%20imaging%20a%20machine.%20A%20Standard%20OS%20Image%20is%20used%20in%20all%20these%20methods%20which%20has%20a%20hash%20associated%20with%20it%20and%20is%20not%20allowed%20to%20be%20modified%20as%20per%20their%20corporate%20security%20standards.%20Now%20there%20is%20a%20specific%20ask%20where%20the%20SCCM%20team%20wants%20to%20keep%20track%20or%20find%20machines%20which%20are%20built%20via%20SCCM%20going%20forward.%3C%2FP%3E%0A%3CP%3EPlan%20is%20to%20generate%20Unique%20GUIDS%2C%20apply%20those%20while%20running%20the%20task%20sequences%20%5BOne%20Unique%20GUID%20for%20One%20Task%20Sequence%5D%20and%20track%20them%20using%20Compliance%20baselines.%20Below%20steps%20can%20be%20followed%20to%20do%20the%20same.%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3EGenerate%20one%20or%20more%20Unique%20GUIDs%20on%20SCCM%20server%20%5BCan%20be%20any%20server%2C%20in%20this%20case%20its%20generated%20on%20SCCM%20server%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3EUse%20this%20method%20to%20generate%20GUIDS.%20%3A%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fmicrosoft.powershell.utility%2Fnew-guid%3Fview%3Dpowershell-6%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fmicrosoft.powershell.utility%2Fnew-guid%3Fview%3Dpowershell-6%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3E%5Bguid%5D%3A%3Anewguid()%3C%2FP%3E%0A%3CP%3Eb982f798-20b6-4419-a4fb-779ceab58c66%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F131388iE5397A23992911DA%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image001.png%22%20title%3D%22image001.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3COL%20start%3D%222%22%3E%0A%3CLI%3ECreate%20a%20cmd%20file%20named%3A%20%3CSTRONG%3Ecmd%3C%2FSTRONG%3Ewhen%20run%20creates%20the%20below%20entries%20in%20the%20registry.%20%5BTest%20this%20cmd%20file%20on%20a%20machine%5D%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%3CEM%3EREG%20ADD%20HKLM%5CSOFTWARE%5CMicrosoft%5CWindows%5CCurrentVersion%5CcontosoBuildInfo1%20%2Fv%20UniqueID%20%2Ft%20REG_SZ%20%2Fd%20%22b982f798-20b6-4419-a4fb-779ceab58c66%22%20%2Ff%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%3CEM%3EREG%20ADD%20HKLM%5CSOFTWARE%5CMicrosoft%5CWindows%5CCurrentVersion%5CcontosoBuildInfo1%20%2Fv%20date%20%2Fd%20%22%25DATE%25%22%20%2Ft%20REG_EXPAND_SZ%20%2Ff%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%3CEM%3EREG%20ADD%20HKLM%5CSOFTWARE%5CMicrosoft%5CWindows%5CCurrentVersion%5CcontosoBuildInfo1%20%2Fv%20time%20%2Fd%20%22%25TIME%25%22%20%2Ft%20REG_EXPAND_SZ%20%2Ff%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%3CEM%3E%26nbsp%3B%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%3CEM%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F131389i63705782433C24DC%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image002.png%22%20title%3D%22image002.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FEM%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorclipboard_image_1%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3COL%20start%3D%223%22%3E%0A%3CLI%3ECreate%20a%20package%20named%20'%3CSTRONG%3EUniqueSCCMBuildInfo'%3C%2FSTRONG%3Eusing%20the%20%3CSTRONG%3Ecmd%3C%2FSTRONG%3Efile%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%3CEM%3ECreate%20a%20Package%20and%20Program%3A%3C%2FEM%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsccm%2Fosd%2Fdeploy-use%2Fmanage-task-sequences-to-automate-tasks%23process-to-edit-a-task-sequence%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsccm%2Fosd%2Fdeploy-use%2Fmanage-task-sequences-to-automate-tasks%23process-to-edit-a-task-sequence%3C%2FA%3E%3C%2FP%3E%0A%3COL%20start%3D%224%22%3E%0A%3CLI%3EEdit%20the%20Task%20sequence%20used%20to%20build%20machine%20example%3A%20XYZTaskSequence%26nbsp%3B%3CSTRONG%3ECON0020E%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%3CEM%3EProcess%20to%20edit%20task%20sequence%3C%2FEM%3E%3A%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsccm%2Fosd%2Fdeploy-use%2Fmanage-task-sequences-to-automate-tasks%23process-to-edit-a-task-sequence%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsccm%2Fosd%2Fdeploy-use%2Fmanage-task-sequences-to-automate-tasks%23process-to-edit-a-task-sequence%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%225%22%3E%0A%3CLI%3EAdd%20the%20'Run%20Command%20Line'%20Task%20Sequence%20step%20as%20the%20last%20step%20named%3A%20'ContosobuildInfo'%20add%20the%20package%20%3A%20'%3CSTRONG%3EUniqueSCCMBuildInfo%3C%2FSTRONG%3E'%3C%2FLI%3E%0A%3CLI%3EEnter%20%3CSTRONG%3Ecmd%3C%2FSTRONG%3Ein%20Command%20Line%20of%20this%20step%20and%20save%20the%20Task%20Sequence.%3C%2FLI%3E%0A%3CLI%3ECreate%20a%20Configuration%20Item%20with%20the%20registry%20values.%20Attached%20is%20the%20CI%20%5BIf%20using%20the%20attached%20CI%2C%20please%20do%20modify%20the%20GUID%5D%3CBR%20%2F%3E%3CSTRONG%3EConfiguration%20Item%3A%20%3C%2FSTRONG%3E%3CEM%3E%3CU%3EContosoUniquebuild-%3CSTRONG%3ECI%3C%2FSTRONG%3E%3C%2FU%3E%3C%2FEM%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CDIV%20id%3D%22tinyMceEditorclipboard_image_2%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3COL%20start%3D%228%22%3E%0A%3CLI%3EAdd%20this%20CI%20to%20the%20Baseline%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%3CSTRONG%3EConfiguration%20Baseline%3A%26nbsp%3B%3C%2FSTRONG%3E%3CEM%3E%3CU%3EContosoUniquebuild-%3CSTRONG%3EBaseline%3C%2FSTRONG%3E%3C%2FU%3E%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%3CEM%3EHow%20to%20Create%20configuration%20baselines%20in%20System%20Center%20Configuration%20Manager%3C%2FEM%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsccm%2Fcompliance%2Fdeploy-use%2Fcreate-configuration-baselines%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsccm%2Fcompliance%2Fdeploy-use%2Fcreate-configuration-baselines%3C%2FA%3E%3C%2FP%3E%0A%3COL%20start%3D%229%22%3E%0A%3CLI%3EDeploy%20the%20baseline%20to%20the%20appropriate%20collection.%3C%2FLI%3E%0A%3CLI%3EMonitor%20the%20compliance%20of%20this%20baseline.%20The%20machines%20which%20are%20compliant%20with%20this%20baseline%20are%20built%20via%20the%20specific%20SCCM%20Task%20sequence.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%3CEM%3EMonitor%20compliance%20settings%20in%20System%20Center%20Configuration%20Manager%3A%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsccm%2Fcompliance%2Fdeploy-use%2Fmonitor-compliance-settings%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsccm%2Fcompliance%2Fdeploy-use%2Fmonitor-compliance-settings%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EPlease%20note%3A%3C%2FSTRONG%3E%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3EIf%20this%20SCCM%20package%20or%20cmd%20file%20is%20deployed%20outside%20of%20task%20sequence%20can%20also%20bring%20the%20machines%20as%20compliant.%20So%2C%20we%20need%20to%20have%20a%20process%5CRole%20Based%20Access%20Control%20which%20secures%20this%20package%5CGUID%5Ccmd%20file%20to%20be%20deployed%20outside%20of%20Task%20Sequence.%3C%2FLI%3E%0A%3CLI%3EAll%20existing%20machines%20will%20be%20non-compliant%20and%20will%20only%20be%20compliant%20once%20they%20are%20re-imaged.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3EA%20default%20report%20%E2%80%98%3CEM%3E%3CU%3EList%20of%20Assets%20by%20compliance%20state%20for%20a%20configuration%20baseline'%3C%2FU%3E%3C%2FEM%3Ecan%20be%20run%20against%20the%20specific%20baseline%20to%20list%20all%20the%20machines%20which%20is%20compliant%2C%20meaning%20these%20machines%20were%20imaged%20using%20the%20image%20example%3A%20%3CEM%3E%3CU%3EContosoUniquebuild.%3C%2FU%3E%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3ENow%20we%20have%20list%20of%20machines%20with%20a%20specific%20image%20built%20using%20SCCM.%3C%2FP%3E%0A%3CP%3EThank%20you!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CDIV%20style%3D%22box-sizing%3A%20border-box%3B%20font-family%3A%20'Segoe%20UI'%2C%20'Helvetica%20Neue'%2C%20'Apple%20Color%20Emoji'%2C%20'Segoe%20UI%20Emoji'%2C%20Helvetica%2C%20Arial%2C%20sans-serif%3B%20font-size%3A%2014px%3B%20font-style%3A%20normal%3B%20font-variant-ligatures%3A%20normal%3B%20font-variant-caps%3A%20normal%3B%20font-weight%3A%20400%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20start%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20white-space%3A%20normal%3B%20widows%3A%202%3B%20word-spacing%3A%200px%3B%22%3EDisclaimer%3CBR%20%2F%3EThe%20sample%20scripts%20are%20not%20supported%20under%20any%20Microsoft%20standard%20support%20program%20or%20service.%20The%20sample%20scripts%20are%20provided%20AS%20IS%20without%20warranty%20of%20any%20kind.%20Microsoft%20further%20disclaims%20all%20implied%20warranties%20including%2C%20without%20limitation%2C%20any%20implied%20warranties%20of%20merchantability%20or%20of%20fitness%20for%20a%20particular%20purpose.%20The%20entire%20risk%20arising%20out%20of%20the%20use%20or%20performance%20of%20the%20sample%20scripts%20and%20documentation%20remains%20with%20you.%20In%20no%20event%20shall%20Microsoft%2C%20its%20authors%2C%20or%20anyone%20else%20involved%20in%20the%20creation%2C%20production%2C%20or%20delivery%20of%20the%20scripts%20be%20liable%20for%20any%20damages%20whatsoever%20(including%2C%20without%20limitation%2C%20damages%20for%20loss%20of%20business%20profits%2C%20business%20interruption%2C%20loss%20of%20business%20information%2C%20or%20other%20pecuniary%20loss)%20arising%20out%20of%20the%20use%20of%20or%20inability%20to%20use%20the%20sample%20scripts%20or%20documentation%2C%20even%20if%20Microsoft%20has%20been%20advised%20of%20the%20possibility%20of%20such%20damages.%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-850259%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20All%2C%20my%20name%20is%20Deepika%20and%20I%E2%80%99m%20a%20Premier%20Field%20Engineer%20with%20Microsoft%20India.%20I%20would%20like%20to%20share%20one%20of%20the%20methods%20to%20identify%20devices%20which%20are%20built%20via%20SCCM.%3C%2FP%3E%0A%3CP%3EImagine%20a%20scenario%20where%20machines%20are%20re-imaged%5Cbuilt%20at%20different%20geographical%20locations%20by%20using%20multiple%20Task%20sequences%20each%20with%20different%20TS%20steps%20and%20with%20different%20Operating%20systems%20Images%20referenced%20in%20it.%20To%20find%20which%20machines%20was%20built%20using%20which%20OS%20image%20will%20be%20a%20tough%20task%20unless%20we%20have%20some%20unique%20value%5Csetting%20available%20to%20differentiate%20in%20these%20images.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-850259%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDeepikaRamdas%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-852505%22%20slang%3D%22en-US%22%3ERe%3A%20One%20Method%20to%20Track%20Devices%20Built%20via%20a%20Specific%20SCCM%20Task%20Sequence%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-852505%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%26nbsp%3B%20Thanks%20for%20bringing%20this%20up%2C%26nbsp%3B%20I%20have%20modified%20the%20step%205%20to%20use%20'Run%20command%20line'%20instead%20of%20'install%20package'%20%5B%20the%20package%20is%20created%20without%20a%20program%5D.%20and%20of%20course%20we%20can%20use%20ps1%20or%20just%20run%20command%20line%20step%20with%20these%20reg%20add%20commands%20directly%20in%20this%20TS%20step.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-857062%22%20slang%3D%22en-US%22%3ERe%3A%20One%20Method%20to%20Track%20Devices%20Built%20via%20a%20Specific%20SCCM%20Task%20Sequence%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-857062%22%20slang%3D%22en-US%22%3E%3CP%3EIf%20we%20were%20to%20implement%20above%20steps%20for%20all%20the%20task%20sequence%20the%20compliance%20status%20will%20not%20work%20on%20past%20deployments.%26nbsp%3B%20Any%20future%20deployments%20can%20be%20monitored%20for%20compliance.%26nbsp%3B%20Right%20or%20Wrong%3F%3F%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E
Microsoft

Hello All, my name is Deepika and I’m a Premier Field Engineer with Microsoft India. I would like to share one of the methods to identify devices which are built via SCCM.

 

Imagine a scenario where machines are re-imaged\built at different geographical locations by using multiple Task sequences each with different TS steps and with different Operating systems Images referenced in it. To find which machines was built using which OS image will be a tough task unless we have some unique value\setting available to differentiate in these images.

 

Here is one instance I encountered where an organization had many methods of imaging a machine. A Standard OS Image is used in all these methods which has a hash associated with it and is not allowed to be modified as per their corporate security standards. Now there is a specific ask where the SCCM team wants to keep track or find machines which are built via SCCM going forward.

Plan is to generate Unique GUIDS, apply those while running the task sequences [One Unique GUID for One Task Sequence] and track them using Compliance baselines. Below steps can be followed to do the same.

  1. Generate one or more Unique GUIDs on SCCM server [Can be any server, in this case its generated on SCCM server

Use this method to generate GUIDS. : https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/new-guid?view=powers...


[guid]::newguid()

b982f798-20b6-4419-a4fb-779ceab58c66

image001.png

  1. Create a cmd file named: cmd when run creates the below entries in the registry. [Test this cmd file on a machine]

REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\contosoBuildInfo1 /v UniqueID /t REG_SZ /d "b982f798-20b6-4419-a4fb-779ceab58c66" /f

REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\contosoBuildInfo1 /v date /d "%DATE%" /t REG_EXPAND_SZ /f

REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\contosoBuildInfo1 /v time /d "%TIME%" /t REG_EXPAND_SZ /f

 

image002.png

 
  1. Create a package named ' UniqueSCCMBuildInfo' using the cmd file

Create a Package and Program: https://docs.microsoft.com/en-us/sccm/osd/deploy-use/manage-task-sequences-to-automate-tasks#process...

  1. Edit the Task sequence used to build machine example: XYZTaskSequence CON0020E

Process to edit task sequence: https://docs.microsoft.com/en-us/sccm/osd/deploy-use/manage-task-sequences-to-automate-tasks#process...

 

  1. Add the 'Run Command Line' Task Sequence step as the last step named: 'ContosobuildInfo' add the package : ' UniqueSCCMBuildInfo'
  2. Enter cmd in Command Line of this step and save the Task Sequence.
  3. Create a Configuration Item with the registry values. Attached is the CI [If using the attached CI, please do modify the GUID]
    Configuration Item: ContosoUniquebuild-CI
 
  1. Add this CI to the Baseline

Configuration Baseline: ContosoUniquebuild-Baseline

How to Create configuration baselines in System Center Configuration Manager https://docs.microsoft.com/en-us/sccm/compliance/deploy-use/create-configuration-baselines

  1. Deploy the baseline to the appropriate collection.
  2. Monitor the compliance of this baseline. The machines which are compliant with this baseline are built via the specific SCCM Task sequence.

Monitor compliance settings in System Center Configuration Manager:

https://docs.microsoft.com/en-us/sccm/compliance/deploy-use/monitor-compliance-settings

 

Please note:

  1. If this SCCM package or cmd file is deployed outside of task sequence can also bring the machines as compliant. So, we need to have a process\Role Based Access Control which secures this package\GUID\cmd file to be deployed outside of Task Sequence.
  2. All existing machines will be non-compliant and will only be compliant once they are re-imaged.

A default report ‘List of Assets by compliance state for a configuration baseline' can be run against the specific baseline to list all the machines which is compliant, meaning these machines were imaged using the image example: ContosoUniquebuild.

Now we have list of machines with a specific image built using SCCM.

Thank you!

 

Disclaimer
The sample scripts are not supported under any Microsoft standard support program or service. The sample scripts are provided AS IS without warranty of any kind. Microsoft further disclaims all implied warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample scripts and documentation remains with you. In no event shall Microsoft, its authors, or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample scripts or documentation, even if Microsoft has been advised of the possibility of such damages.
3 Comments
Frequent Visitor

Hi, 

 

I was trying the steps you mentioned above.  When, I try to add registry keys as a command file it is in a loop.  Not sure, If, I have something wrong within the CMD file.  I saved the file reg.cmd.

 

I was able to accomplish the task through PowerShell.  Added each registry entry individually and all the entries show up in registry now.

 

My question is when, I create a package will my reg.cmd work?  This is what is in the reg.cmd file

 

REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\ramlanBuildInfo1 /v UniqueID /t REG_SZ /d "dfeee803-daf6-4d65-8c7d-832c3e56c04b" /f

REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\ramlanBuildInfo1 /v date /d "%DATE%" /t REG_EXPAND_SZ /f

REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\ramlanBuildInfo1 /v time /d "%TIME%" /t REG_EXPAND_SZ /f

Microsoft

Hi,  Thanks for bringing this up,  I have modified the step 5 to use 'Run command line' instead of 'install package' [ the package is created without a program]. and of course we can use ps1 or just run command line step with these reg add commands directly in this TS step.

Frequent Visitor

If we were to implement above steps for all the task sequence the compliance status will not work on past deployments.  Any future deployments can be monitored for compliance.  Right or Wrong???