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.
This would cut out one step for you - cserrins 12 years ago
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 11 years ago
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 12 years ago
[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 12 years ago