/build/static/layout/Breadcrumb_cap_w.png

Get Image Date - Post Install

I have a post install task running to get the image date of the machine. I thought I would share in case it benefited anyone else. I know the K2 has reports, but if it has been months since that image it sometimes can be a little challenging.

First create your Powershell script. I saved this one as "image_date.ps1".

$file= "C:\ProgramData\Dell\Cust_Logs\image_date.txt"

$path= "C:\ProgramData\Dell\Cust_Logs"

Function imagedate {get-date |out-file $file
}
if(Test-Path $path)
{imagedate}
else
{mkdir $path|
imagedate}

Get-Content $file |select -Skip 1| Set-Content "$file-temp"

move "$file-temp" $file -Force


Create a post install to run this task.

Create your custom inventory rule.

After the next inventory the image date will show in the custom inventory.


Comments

  • Why not just pull in the k2000_deployment_info.conf file placed in %allusersprofile%\Dell\KACE\k2000_deployment_info.conf?

    This would cut out one step for you - cserrins 11 years ago
    • I tried this, but the file has got the date of the time the image was made. Not when the PC image was rolled out. - dmace 10 years ago
      • On the K2000, check the image you captured by browsing the file and going to the location above. For windows vista and higher, this would be the os drive and
        ProgramFiles\Dell\KACE\
        is the k2000_deployment_info.conf in the image?
        If so browse back to the ProgramFiles directory and delete the Dell directory, close the window and then commit your changes. - cserrins 10 years ago
  • I am running a .cmd script post install task under Windows that checks both C:\Kace and C:\ProgramData\Dell\Kace for k2000_deployment_info.conf and imports each entry into its own registry entry, then I use the custom inventory item for each of the items that I want pulled from that data.

    if exist C:\Kace\k2000_deployment_info.conf (
    for /f "tokens=1* delims==" %%i in (C:\Kace\k2000_deployment_info.conf) do (
    reg.exe add "HKLM\Software\MyCompanyName\K2000" /f /v "%%i" /t REG_SZ /d "%%j"
    )
    ) else (
    if exist C:\ProgramData\Dell\Kace\k2000_deployment_info.conf (
    for /f "tokens=1,2* delims==" %%i in (C:\ProgramData\Dell\Kace\k2000_deployment_info.conf) do (
    reg.exe add "HKLM\Software\MyCompanyName\K2000" /f /v "%%i" /t REG_SZ /d "%%j"
    )
    )
    )

    And we are pulling 3 different custom inventory items from it:

    RegistryValueReturn(HKEY_LOCAL_MACHINE64\SOFTWARE\MyCompanyName\K2000,deployment_name,TEXT)

    RegistryValueReturn(HKEY_LOCAL_MACHINE64\SOFTWARE\MyCompanyName\K2000,deployment_time,DATE)

    RegistryValueReturn(HKEY_LOCAL_MACHINE64\SOFTWARE\MyCompanyName\K2000,deployment_type,TEXT)

    This gives us whether it was a system image or scripted install, the name of the system image/scripted install, and the when it was installed as a date value, which properly converts the text in the file to the appropriate time zone as well. Due to some strangeness with WinPE and time zone changes, we found that the actual modified date on the k2000_deployment_inf.conf file was off by a few hours and we have smart labels that trigger certain things depending on how recent the install time was.

    We're using HKEY_LOCAL_MACHINE64 so that the custom inventory pulls from the 64 bit registry on the 64 bit machines. - ncsutmf 11 years ago
  • we started added keys to the registry that the k1000 then picks up as installed software. I can quickly do a software inventory search for "TMCC Image" and get a list of every image version out there and how many of each. I edit and merge this key set in my sysprep batch file prior to the sysprep.exe running

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\TMCC IMAGE INFO]
    "Comments"="Installed office and updated"
    "Contact"="SMal"
    "DisplayVersion"="Acad32F12 All Sites 061212"
    "HelpTelephone"="57800"
    "Publisher"="WIM file acf12allst"
    "DisplayName"="TMCC Acad Image"
    "Readme"="The Display Version is the K2000 image name" - SMal.tmcc 11 years ago
This post is locked
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ