OSD Tattooer Script
osd tattoo powershell district


Latest version  = 1.4.3


Version 1.4.3 is out! (16/08/2015)

 I have added the following minor changes in version 1.4.3:

  • Added Online help. Use get-help .\New-OSDTattoo.ps1 -Online to get the latest help, version of the script, and other infos (Will redirect you to this page).
  • Commented OSDVuildVersion TS variable out.

See lower for download link

Version 1.4.2 is out! (14/04/2015)

I have done a very small modification to the variables names that where tattooed. It fixes a small bug that would Pop up when we would try to Import the WMI class in ConfigMgr when extending the Hardware Inventory.

The following two Tattoos have been renamed:

  • PSDistrict_TaskSequenceName became –> PSDistrict_TSName
  • PSDistrict_TaskInstallationID became –> PSDistrict_TSId

See lower for download link

Version 1.4.1 is out! (15/02/2015)

I have received some great feedback recently concerning the OSD Tatooer. The version 1.4 is now uploaded to Technet.

  • minor bug corrections (Change Root Switch To string).
  • Added WMI instance Creation.

Version 1.1 is out!:

I have added the following features in version 1.1 (01/16/2015):

  • Root switch

This will allow to specify the name of the root registry hive / WMI Class.

  • Correction of minor bugs
  • Updated Comment based help

See lower for download link


 

Download Script

You can download immediately the latest version here from technet here (And PLEASE rate this script on technet by clicking on the Yellow stars) –> Technet

Continue reading to see how this solution works.


 

OSD Tattooer Script

Are you a deployment engineer, or are you working with Operating System deployment and are you using ConfigMgr to do so and you need to tattoo information into your windows image? This blog post is exactly what you are looking for!

It is a common practice to tattoo the Windows Image during OSD to have global information of your image into your final build machine. This helps to identify information such as different versions of image, which task sequence has been used, when it got installed, who initiated the process how long the task sequence execution was etc.. Actually, only your imagination will limit your tattooing needs here.

The following script I am sharing here is a script that will be the most useful for all the deployment engineers.

I will demonstrate in this post how we can tattoo the following places very easily using Powershell:

  • Registry
  • Environment variables
  • WMI repository

As a side note I have tested this script on Configmgr 2012 but it should also work on ConfigMgr 2007. Let me know how it work for you by commenting in the comment section below!

How to OSD tattoo your Windows image?

The process is pretty straight forward, simply follow the next 3 steps and that should do the trick 🙂

1)Download the script:

First things first, you will need the New-OSDTatoo.PS1 script. You can download it here under. (and also rate it by clicking on the yellow stars ;)).

Download the New-OSDTattoo.ps1 script here –> Technet

 

2)Create a Package:

Create a SCCM package without a program with the New-OSDTattoo.ps1 script, and upload it to your desired distribution points.

 

3)Create a PowerShell step in the task sequence:

Create a powershell execution script at the end of your task sequence and and add your package to it.

Run powershell ScriptAnd add the  package to the task and call it as follow:

Task sequence

In the example above, we are tattooing the variables only into the registry.

And that’s it! Simple isn’t it? (See the example below to fine tune things a bit more for your environment).

How to Tattoo OSD information using PowerShell?

In order to be able to specify a Registry root and/or a WMI class name, you will have to call the script the fallowing way.

Osd tattoo

The example above will tattoo the OSD information using the switch “All” in the root named “BPUG“.The “All” switch will tattoo the information in the following locations:

  • Registry (HKLM:\Software\<ValueOfroot>)
    • HKLM:\Software\BPUG
  • WMI Repositroy (Root\Cimv2\<ValueOfRoot>)
    • Root\Cimv2\BPUG
  • Environment variables (Root has no influence here).

The Root switch is only available in the version 1.1 of OSDTattooer script. Be sure to have downloaded the latest one.

Download the New-OSDTattoo.ps1 script here –> Technet

How to osd tattoo the registry during SCCM OSD deployment?

In order to tattoo the registry, we will use the New-OSDTattoo.ps1 script I wrote that you can download here.

If you use the script New-OSDTattoo.ps1  it will be a peace of cake!

Simply add a PowerShell Script step in your Task sequence and call the script as followed:

This would be the an example of the result you would get:

powershell osd tattoo-results-registry configmgr

How to osd tattoo the WMI repository during SCCM OSD deployment?

 

Again, If you use the the script New-OSDTatoo.ps1 , it will be a peace of cake!

Simply add a PowerShell Script step in your Task sequence and call the script as followed:

This would be an example of the results you could get:

osd-tattoo-results-wmi-class

 

I used some functions from the WMI-Module I wrote some time back for this section. Here under you will find a bit more information on WMI in general and WMI related information.

If you have no understanding of WMI and are curious to learn the basics from scratch, I recommend you take a look at this WMI introduction presentation I have done for the Bengalore PowerShell usergroup. The link is right here –> PSBUG WMI introduction

Also, have a look at the WMI week articles I wrote. They they could be handy if you need to use powershell + wmi –> WMI Week.

If you are interested in WMI, you can take a look and see how I did here –> WMI-Commands.psm1

 

How to osd tattoo Windows environment variables during SCCM OSD  deployment?

If you want to set environment variables in SCCM during OSD deployment, use the script New-OSDTatoo.ps1 I wrote , it will be a peace of cake!

Simply add the tattoo script step in your Task sequence and call the script as followed:

This could be an example that you could have:

powershell osd tattoo results environment variables configmgr

 

Of course,  you could have added the -Root “YourPrefix” switch. It would have then named the main class / registry hyve “YourPrefix“. (You can change this value to anything that suites you own needs, like your company name for instance). In this case, it was left to the default, which starts with psdistrict_ and which works just fine 🙂

As a side note, if the -Root switch is not specified, the default value name of the hyve / WMI class will be OsBuildInfo (So your tattooed information will be in HKLM:\software\OsBuildInfo if you do not specify any value for Root).

 

Script details:

The script is pretty easy to understand actually, and there is not much to be changed in it in order to be adapted to your own (or client(s)) environment.

By default, I set the following information in the tatoo mechanism:

So this tattoos the TaskSequence installation name, Boot image version, DeploymentID, Installation Method, TaskSequence Installation ID, the SCCM Site code that it is assigned to, and the current build version.

As you can see, almost all of these variables are read only variables. (See the following post on more information on Task Sequence variables –> Task sequence variables )

Each of the variables start with a prefix which is oringinaly set to $PSDistrict_ as you can see from line 592 to 598.

PsDistrict prefix

You can add any other OSD default variable to this list, easily by adding a new line respecting the prefix.

How to add a custom osd variable to a Windows Image?

This became actually very easy with the New-OSDTatoo.ps1 script. If you have an custom HTA in your task sequence where you can set different variables that will later on then be read by your Task sequence in order to do conditional actions, you can use the script in order to tatoo these custom variables as well.

Indeed, the important point here, is that they respect the prefix naming convention, which in the original case of this script is PSDistrict. In other words the, if you create a variable in your HTA that you would like to be tatooed into your Windows Image, all you need to do is to add a prefix to your variable. Easy isn’t? still not clear? let’s go through it together with an example.

Example:

This example might make it more clear. Let’s say you have a custom variable call “InstalledBy” that you would like to be tatooed into your registry so you can track which technician has deployed a PC.

Let’s say that this variable is already existing, and you just want to tatoo it in your registry, either change the variable name like follow: PSDistrict_InstalledBy

or, copy the old InstalledBy variable into a new variable called PSDistrict_InstalledBy and that’s it. The script will add all the variables that have a prefix of PSDistrict_ as a tatoo value. This makes it very easy to add new tatoos in your image because you will only need to worry about the new variables you will add during your task sequence, and the ones that are prefixed correctly, will automatically be written to either the registry, WMI repository, as environment variable, or simply all of them.

[stextbox id=”note”]The prefix could potentially be changed to the one you like by modifying it directly in the script. I would recommend though, that in order to keep things easy you stick with the default prefix .[/stextbox]

Download script:

The complete script listing is located here under, but you can download the script directly from technet on the download link here under.

I have removed the script listing which allows me to maintain code at only one place; Technet. Please use the link below to get the latest version of the script.

Download the New-OSDTattoo.ps1 script here –> Technet

By | 2016-12-02T15:28:14+00:00 January 5th, 2015|ConfigMgr, ConfigMgr 2007, ConfigMgr 2012, OSD, PowerShell, Sticky, WMI|44 Comments

About the Author:

Stéphane is a dynamic and passionate Cloud and datacenter Microsoft MVP since. He is the founder of the Basel PowerShell user Group (BPUG), the co-founder of the French Speaking PowerShell UserGroup (FRPSUG), author, blogger, and received the community award "PowerShell Hero" from PowerShell.org. Stéphane has implemented microsoft infrastructure solutions in various countries of Europe and is currently working in Basel / Switzerland. Stéphane help his clients to reduce their global infrastructure costs by implementing Microsft infrastructure solutions by combining great products such as System Center, Windows Server, with heavy automation using Windows PowerShell. Stéphane loves languages, Belgium beer, French cheese and French Wine. If any of these topics are of your interest, don't hesitate to come and say hi.

44 Comments

  1. Cory December 28, 2016 at 9:05 pm - Reply

    So working on Tattooing Image Builds and Deployments. The place I work now they tatoo the reference image in the following location:
    HKLM\Software\Company\Deployment\Reference Image and then the values go here. Then when they do Production Rollout the Tatoo here HKLM\Software\Company\Deployment\

    How can I make this script right to these locations?

    • svangulick December 28, 2016 at 10:13 pm - Reply

      Hi Cory,

      Since your keys are locatd under the HKLM:\Software node you can do that using the -Root parameter. An example of what the Task sequence parameter would be are lsited below:
      -All -Root Company\Deployment
      or
      -All -Root HKLM\Software\Company\Deployment\ReferenceImage

      The root switch was intended to specify only one node depth, and I haven’t tested it like that. Let me know if this works.

      #Stéphane

    • Stephane January 18, 2017 at 8:03 am - Reply

      Hi corry,

      Sorry for the late reply. The script uses a function called ‘new-osdtattoo’ it has a parameter called -registryroot that defaults at hklm:\software . you can use that switch to change the path.

      Let me know if this works for you.

      #stéphane

  2. Billy December 22, 2016 at 1:26 pm - Reply

    Stephane,

    Thanks for providing a really great script, however I am encounter some problems when I try and add additional SCCM OSD default variables, the scripts runs successfully, however when I check the registry the only items that are present are your original 6 items. The log file in the c:\windows\ccm\logs\new-osdtattoo.log shows the following error at c:\_SMSTaskSequence\Package\new-osdtattoo.ps1:789 char:106 which relates to New-RegistryItem -RegistryPath $FullRegPath -RegistryString $PropertyName -RegistryValue $PropertyValue within the script.

    The errors list that they cannot add the additional registry entries because its an empty string, am I doing something wrong as I thought that I just needed to added additional entries and that they would work as long as the line started with the $PSDistrict_ prefix.

    • Stephane December 22, 2016 at 1:52 pm - Reply

      Hi Billy, thanks for your comment. This might be a bug. Could you somehow give me access / a copy to the New-OsdTattoo.log, and the smsts.log files.
      Also, what machine are you trying to tatto (which OS) and which version of Powershell does it have. that would help me greatly to point to the source of the issue.

      Happy Christmas ^^

      • Stephane December 22, 2016 at 1:54 pm - Reply

        Also, please give me the exact line you are using to 1) call the script, 2) how you are setting the variables in your TS (provide a screenshot maybe?)

      • Billy December 22, 2016 at 3:52 pm - Reply

        Stephane,

        I have emailed across the logs as requested to your stephanevg at powershelldistrict.com email address. The machines I am trying to tattoo are windows 10 machines (I know that you state on your site that it hasn’t been tested, but I thought since it was “tattooing some information” that it might be ok) to call the script I followed your example on the web page by creating a program and calling the script with the -All -Root “Aggreko” .

        Billy

        • Stephane December 28, 2016 at 10:31 pm - Reply

          Hi Billy, I hope you have enjoyed your Christmas holidays.
          Somehow I didn’t receive the email you were talking about. Do you mind sending it again?
          thanks

          • Billy December 29, 2016 at 5:19 pm

            Stephane, Yes I did thanks, not back to work until 4th Jan which is nice. Hope you had a nice break as well, I have resent the files again

          • Stephane December 29, 2016 at 5:36 pm

            Thakns, I will answer your email shortly.

          • Billy Cullen January 12, 2017 at 10:06 pm

            Stephane,

            Thanks for all your assistance in helping me getting the script to work with my additional variables, the problems I was having was due to me not inputting the correct variable before the _variablename.

          • Stephane January 13, 2017 at 12:00 am

            Awesome! Happy I could help!
            Just to recap for the users: dont forget to add the prefix prior your variables names in your TS. (By default, the prefix is ‘PSDistrict_’)

  3. JB September 28, 2016 at 5:20 pm - Reply

    So I get New-OSDTattoo : A parameter cannot be found that matches parameter name ‘Name’. on line 946 of the script.

    I’m doing new-osdtattoo.ps1 -registry -root “XYZ”

    • Stephane September 28, 2016 at 5:54 pm - Reply

      Hi JB,
      Can you tell me how did you tested this?

  4. Tom February 16, 2016 at 11:21 pm - Reply

    Hi,

    I would like to run the 1.4.3 script on sccm 2012 and not r2, there is no powershell command line in sccm 2012,

    can you please send me the steps for this, im not a scripting guru your help is greatly appreciated

  5. David Grand December 29, 2015 at 7:00 am - Reply

    Stephane,
    You have done a fantastic job! And saved me hours and hours of research and work. Thank you for the excellent script. I just ran the Tattoo plus Time Mange as my newest Tasks and my test deploy looks fantastic. I gave you 5 stars at TechNet.
    Thank you, once again!

    • Stephane December 29, 2015 at 10:17 am - Reply

      Thanks a lot for your comment and technet ratings David. It is higly appreciated! 🙂
      I am glad I could help you and the community out 🙂
      Please let me know if you find anything that could be added to any of these scripts.

  6. Yinghua Zeng August 16, 2015 at 8:44 pm - Reply

    I think it should be OSDImageVersion, and this variable is only give you value if you have set it when you captured a image.

    • Stephane August 16, 2015 at 9:27 pm - Reply

      Thanks for your message Yinghua.
      OBuildVersion is a custom variable that is set during the task sequence as a custom variable step.

      Since this is not a configuration that everyone have, I have commented it out in the version 1.4.3

      I have also added some online help support. In the future, use “get-help .\New-OSDTattoo.ps1 -Online” when searching for help, and you will be redirected to this page, containing the latest help, tips, info’s, and script.

      #Stéphane

  7. Yinghua Zeng August 16, 2015 at 8:39 pm - Reply

    thank you for the script. I tested it, works nicely. Only that OsBuildVersion variable didn’t work, I think that is not SCCM OSD default variable?

  8. Tom June 4, 2015 at 3:09 am - Reply

    Hi,

    I’m not a very scripting guru, if i want to change the name of the script or specify the version of my build how can i do that?

    I also need it too insert the data as well.

    any possibility this can be this?

    thanks

    • Stephane June 4, 2015 at 5:49 am - Reply

      Hi Tom,

      If you look at the section: How to add a custom variable to a “Windows Image”, you will see that that you can easily add any new value to your image by simply creating a new Custom variable in your task sequence, and name it a prefix “PSDistrict_”. You could for eample create a variable named “PSDistrict_BuildVersion” and the value that is contained in this TS variable will be tattooed to the select place (Registry, WMI or Environment variable).

      Concerning the Script renaming, you can go ahead, that really doesn’t influence how it works (Just be sure to call it with the good name).

      Have fun!

  9. jaccc February 20, 2015 at 8:33 pm - Reply

    He Stephane and thanks for the script, but “Woop” or “OSBuildinfo” are not adding to the Registry.

    I’m new to PS.

    Have added the package to SCCM 2012 R2 with no program.
    Your script untouched
    distributed etc..
    Added to TS:
    New-OSDTattoo.ps1
    Parameters:
    -All -Root (Also tried -All -Root “Company”)

    Latest Errors:
    Working dir ‘C:\_SMSTaskSequence\Packages\CM100270’ RunPowerShellScript 2/20/2015 11:59:06 AM 608 (0x0260)
    Executing command line: Run Powershell script RunPowerShellScript 2/20/2015 11:59:06 AM 608 (0x0260)
    Exception getting “Value”: “The parameter is incorrect. (Exception from HRESULT RunPowerShellScript 2/20/2015 11:59:07 AM 608 (0x0260)
    : 0x80070057 (E_INVALIDARG))” RunPowerShellScript 2/20/2015 11:59:07 AM 608 (0x0260)
    At C:\_SMSTaskSequence\Packages\CM100270\New-OSDTattoo.ps1:624 char:63 RunPowerShellScript 2/20/2015 11:59:07 AM 608 (0x0260)
    + New-Variable -Name $CustomVariable -Value $tsenv.value <<<< ($CustomV RunPowerShellScript 2/20/2015 11:59:07 AM 608 (0x0260)
    ariable) RunPowerShellScript 2/20/2015 11:59:07 AM 608 (0x0260)
    + CategoryInfo : NotSpecified: (:) [], GetValueInvocationExceptio RunPowerShellScript 2/20/2015 11:59:07 AM 608 (0x0260)
    n RunPowerShellScript 2/20/2015 11:59:07 AM 608 (0x0260)
    + FullyQualifiedErrorId : CatchFromBaseAdapterParameterizedPropertyGetValu RunPowerShellScript 2/20/2015 11:59:07 AM 608 (0x0260)
    eTI RunPowerShellScript 2/20/2015 11:59:07 AM 608 (0x0260)
    RunPowerShellScript 2/20/2015 11:59:07 AM 608 (0x0260)
    Class True created. RunPowerShellScript 2/20/2015 11:59:07 AM 608 (0x0260)
    RunPowerShellScript 2/20/2015 11:59:07 AM 608 (0x0260)
    RunPowerShellScript 2/20/2015 11:59:07 AM 608 (0x0260)
    NameSpace: ROOT\cimv2 RunPowerShellScript 2/20/2015 11:59:07 AM 608 (0x0260)
    RunPowerShellScript 2/20/2015 11:59:07 AM 608 (0x0260)
    Name Methods Properties RunPowerShellScript 2/20/2015 11:59:07 AM 608 (0x0260)
    —- ——- ———- RunPowerShellScript 2/20/2015 11:59:07 AM 608 (0x0260)
    True {} {PSDistrict_BootIma… RunPowerShellScript 2/20/2015 11:59:07 AM 608 (0x0260)
    Class True is already present. Skiping.. RunPowerShellScript 2/20/2015 11:59:10 AM 608 (0x0260)
    True {} {PSDistrict_BootIma… RunPowerShellScript 2/20/2015 11:59:10 AM 608 (0x0260)
    New-RegistryItem : Cannot bind argument to parameter 'RegistryValue' because it RunPowerShellScript 2/20/2015 11:59:10 AM 608 (0x0260)
    is an empty string. RunPowerShellScript 2/20/2015 11:59:10 AM 608 (0x0260)
    At C:\_SMSTaskSequence\Packages\CM100270\New-OSDTattoo.ps1:593 char:105 RunPowerShellScript 2/20/2015 11:59:10 AM 608 (0x0260)
    + New-RegistryItem -RegistryPath $FullRegPath -RegistryString $ RunPowerShellScript 2/20/2015 11:59:10 AM 608 (0x0260)
    PropertyName -RegistryValue <<<< $PropertyValue RunPowerShellScript 2/20/2015 11:59:10 AM 608 (0x0260)
    + CategoryInfo : InvalidData: (:) [New-RegistryItem], ParameterBi RunPowerShellScript 2/20/2015 11:59:10 AM 608 (0x0260)
    ndingValidationException RunPowerShellScript 2/20/2015 11:59:10 AM 608 (0x0260)
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAl RunPowerShellScript 2/20/2015 11:59:10 AM 608 (0x0260)
    lowed,New-RegistryItem RunPowerShellScript 2/20/2015 11:59:10 AM 608 (0x0260)
    RunPowerShellScript 2/20/2015 11:59:10 AM 608 (0x0260)
    Class True is already present. Skiping.. RunPowerShellScript 2/20/2015 11:59:13 AM 608 (0x0260)

    Any Help would be appreciated and you can contact me directly to my email if its faster.
    thanks, JACCC

    • Stephane February 25, 2015 at 12:14 am - Reply

      Hey jacc. Sorry for the late response, but as you can see, I have been working on some changes here 😉 Can you give me your email address and /or send me smsts.log file so I can take a deeper look into it? Email will defenitly be quicker i guess.Thanks in advance

      • jaccc February 25, 2015 at 5:19 pm - Reply

        Yes…please email me at jdeeds@ssfcu.org and attach your new script and I will test it out.
        thanks!

    • Stephane February 25, 2015 at 9:53 am - Reply

      Hi Jacc, I actually have a new version of the script. If you want, you can test it out for me before I publish it here. Also, for a quick fix, you can change this:

      [Parameter(Mandatory=$false)][Switch]$Root = “OsBuildInfo”

      To this:

      [Parameter(Mandatory=$false)][String]$Root = “OsBuildInfo”

  10. Rick February 10, 2015 at 5:28 pm - Reply

    Hi Stephane – This looks great but isn’t working for me for some reason. I’m probably doing something wrong. I have it in my TS and it runs the script but I’m not getting anything written to the registry. If I look in my TS log it appears to successfully run (snippet below). After the step runs I check the registry but there is no HKLM\Software\OSDBuildInfo key. Any idea what I’m doing wrong?

    Thanks Much.
    Rick

    Microsoft Deployment Toolkit version: 6.1.2373.0
    The task sequencer log is located at C:\WINDOWS\CCM\Logs\SMSTSLog\SMSTS.LOG. For task sequence failures, please consult this log.
    PowerShell version detected: 2.0
    About to run: “C:\_SMSTaskSequence\WDPackage\Tools\Modules\Microsoft.BDD.TaskSequenceModule\Microsoft.BDD.TaskSequencePSHost35.exe” “C:\_SMSTaskSequence\Packages\PP10038C\New-OSDTattoo.ps1” “C:\WINDOWS\CCM\Logs\SMSTSLog” -Registry
    Process completed with exit code 0
    ZTIPowerShell processing completed successfully.
    Command line returned 0

    • Stephane February 11, 2015 at 9:37 am - Reply

      Hi Rick,

      A quick possible solution:
      Have looked if there was a reg key named “Woop” instead of “OsBuildInfo” ?

      I have updated the script with some improvements and minor bug fixes which might solve your issue, but I haven’t been able to fully test it yet.
      If you would like to be a beta tester, send me your email adress and I will give you a copy before I ‘Officialy’ release the new version.

      Regards

      Stéphane

  11. bigMIKE February 5, 2015 at 9:44 am - Reply

    Stephane,

    In your screenshot of the Powershell Task Sequence step you specify the script name as “New-OSDTatoo.ps1 -Registry”.

    If I do that in my Task Sequence step I get an SCCM 2012 error message saying “Specify the name of the Powershell script”.

    thanks…Mike

    • Stephane February 5, 2015 at 1:08 pm - Reply

      Hi BigMike,

      Check the following points:
      1) be sure to call the good name of the script. (version 1.2 the script is called : New-tattoo.ps1 (with two “tt”).
      2) be sure to create a package without a program.
      3) push the content to the DP’s.

      Let me know if it works.

      Regards

      Stéphane

      • bigMIKE February 5, 2015 at 6:15 pm - Reply

        thanks for the speedy reply Stéphane.

        yes, I have a packages created with no program and contents distributed to DPs.

        when the job runs I see the following errors in the SMSTS.LOG

        Executing command line: Run Powershell script
        C:\_SMSTaskSequence\Packages\CC400019\New-OSDTattoo.ps1 : A positional parameter cannot be found that accepts argument ‘Woop’.
        At line:1 char:1
        + & ‘C:\_SMSTaskSequence\Packages\CC400019\New-OSDTattoo.ps1’ -all -root Woop ; ex …
        + CategoryInfo : InvalidArgument: (:) [New-OSDTattoo.ps1], ParameterBindingException
        + FullyQualifiedErrorId : PositionalParameterNotFound,New-OSDTattoo.ps1
        Process completed with exit code 1

        version 1.2 of the script ?? the links on this page download “New-OSDTattoo.ps1” which, when edited, says its version 1.1

        Your reply talks of New-tattoo.ps1 but the link on this page downloads New-OSDTattoo.ps1

        Thanks
        Mike

        • Stephane February 11, 2015 at 9:13 am - Reply

          Hi bigmike,

          Sorry for the late reply. have you tried to add “” arround the root entry?

          something like this:

          New-OSDTattoo.ps1 -all -root “Woop”

        • Stephane February 26, 2015 at 3:34 pm - Reply

          Hi BigMike,

          I have done some tests in my lab and have corrected some minor bugs which might have been causing your troubles. I have updated the script to version 1.4.
          Can you download the new version and try again? Please let me know how it works out for you?

          You can perhaps contact me directly at stephanevg at powershelldistrict.com

          Thanks in advance.

  12. Raja January 15, 2015 at 9:23 pm - Reply

    Hi Stephane ..

    Your scripting information is really helpful for everyone who start from beginning ..It is really a good job .. Thanks for sharing all your knowledge in public forum .

    Thanks….
    Raja

    • Stephane January 16, 2015 at 5:25 pm - Reply

      Thank you very much for the nice words Raja.Higly appreciated. I am doing my best to spread the knowledge. 🙂

  13. Stephane January 15, 2015 at 5:00 pm - Reply

    Hi Eden, thank you for your comment.

    Technically, you could set this script anywhere after the “apply Windows image” step. But I would recommend to put it as close as to the end of the task sequence possible. By doing so, you will allow your self to add the latest information into your tattooed image.

    In my case (cf this article) I have added it before the install application section, since all the information I wanted to have tattooed into my Window image.

    At another customer, I needed to measure the task execution time and tattoo this information as well . I could tattoo this information only once I had that information. Therefore, the tattoo section was the very last step of my task sequence. (for more details concerning this process follow this link –> http://powershelldistrict.com/sccm-how-to-measure-task-sequence-execution-time/ )

    I hope this helps 🙂

    • Eden Oliveira January 15, 2015 at 5:56 pm - Reply

      Hi Stephane!

      Thank you very much for the quick feedback.

      One More question, I have already placed the powershell after the step you requested.

      Now, once my Deployment is done, where on my registry I will be able to find those tattooed information. in which Key section?

      Another last question is, in regards to the way I have to set up the MDT run powershell script.

      That’s how I have set up (Please correct me if I am wrong).

      In My SCCM 2012 R2 TS (Integrated with MDT), I have created a MDT “Run powershell script” task and I added it on the State Restore Section.
      I have placed the MDT powershell script right before Install applications portion (after the “gather” and “tattoo” task)

      The settings of the script are:

      Name OSD Tattoo
      Powershell script:
      New-OSDTattoo.ps1
      Parameters: -Registry
      Checkbox: Use package, then I browse to my newly created and distributed package with the PS1 file.

      Is that all I have to do?

      Thanks a lot again.

      Eden

      • Stephane January 16, 2015 at 5:24 pm - Reply

        Hi Eden,

        Thank you for raising this point up. It was possible in the version 1.0 but perhaps not really that straitgh forward. Therefore I have updated the OSD Tattooer Script to it’s version 1.1, Which includes the possibility to use a switch called “Root”. When speceified, it allows users to specefiy the registry hyve name and/or WMI class name.
        If the switch is not used, it will then use the default value of “OSBuildInfo”.

        I have updated the article with some examples and screen shots.

        I hope this helps 🙂

        Kind regards

        Stéphane

        Ps: You will need to download (and rate ;)) the latest version of the script on technet (link is above).

        • Eden Oliveira January 19, 2015 at 5:19 pm - Reply

          Good morning Stéphane! Thank you very much for helping us!

          I will be testing the script today and Ill get back to you soon with updates.

          Question: I have set up the same parameters as you have posted on the screenshot, I wouldnt like to be prompted for input during TS. Will that settings be “silent” ? And I would be only interested on Tattooing the Registry (I am not using the -Registry that you have mentioned above because it had caused me and error. I am using the whole parameters (because the -Registry causes me the Red X message).

          I believe I didn’t get your comments quite well.

          I only need to tattoo the info on my Deployed image.

          Thanks again.

          Eden

          • Eden Oliveira January 19, 2015 at 6:43 pm

            Hi Stephane, I finally could test, but I got and error. I believe my Powershell version is set to 2.0, which I didnt expected.

            And also, an interesting message says:
            indFile: The file New-OSDTatoo.ps1 could not be found in any standard locations. ZTIPowerShell 1/19/2015 12:08:03 PM 0 (0x0000)

            Any clue?

            Thanks a lot for your support again.

            Eden Oliveira

            See log below:

            PowerShell version detected: 2.0 ZTIPowerShell 1/19/2015 12:08:03 PM 0 (0x0000)
            FindFile: The file New-OSDTatoo.ps1 could not be found in any standard locations. ZTIPowerShell 1/19/2015 12:08:03 PM 0 (0x0000)
            Unable to locate script New-OSDTatoo.ps1 ZTIPowerShell 1/19/2015 12:08:03 PM 0 (0x0000)
            ZTI ERROR – Non-zero return code by ZTIPowerShell, rc = 10901 ZTIPowerShell 1/19/2015 12:08:03 PM 0 (0x0000)
            Unable to create WebService class ZTIPowerShell 1/19/2015 12:08:03 PM 0 (0x0000)

          • Stephane January 20, 2015 at 1:10 pm

            Hi Eden,

            Thanks for your comment. I have looked into it and it seems like you have not the latest version of the script. Download it again from technet (link above in the article) since I have updated the script since the first time I shared it.
            PowerShell version 2.0 should work just fine. I have tried to write the script so that it would be as retro-compatible as possible.
            I see two things that could be the source of your problem:
            1) Since you seem to have a MDT integration, you should should either add the Script New-OSDTattoo.ps1 (in it’s version 1.1) to your current MDT script package, update it to your distribution points, and try again.
            2) Or you could simply follow the steps explained above in the article and use the “Regular” PowerShell script task (and thus not the MDT one) By clicking “Add General/Powershell Script”.
            2.1) Add the package that you have previously created (without a program).
            2.2) Add the script parameters as specified in the article examples above.

            I hope this helps 🙂

            Cheers

            stéphane

  14. Eden Oliveira January 15, 2015 at 4:47 pm - Reply

    Good morning Stephane, Thank you for your information, That’s something I was thinking about this week, but since I am not a scripting person, I decided to look for that on the web.

    I am looking for tattooing every deployment with a Image Version (Something that will keep track of the version of the Image I have used. (If I can tattoo more details about the TS also, that’d be great.

    My question is, Where I should place the powershell script on my TS (after which step)?

    Is there a special account to run? My image has already powershell injected to it.

    Thanks a lot!

    Eden Oliveira

  15. Stephen Owen January 6, 2015 at 3:51 pm - Reply

    If anyone is curious about why they should do this, it is an industry best-practice to tattoo system build properties into your systems when you build them at OSD.

    it’s a great way to do reporting and be able to tell which Task Sequence and WIM was used to build your machines, in case you run into any issue in the environment with a particular build.

    • Stephane January 7, 2015 at 10:57 am - Reply

      Thanks for clarifying this Stephen 🙂

Leave a Reply

%d bloggers like this: