Closed Yannik closed 1 month ago
Does this fact exist in another location like the registry. We are trying to avoid adding any extra calls to WMI/CIM because it slows the overall module down and non-admins cannot access this information.
It looks like it may be present on the InstallTime
registry value
$osInfo = Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' -Name InstallTime
[DateTime]::FromFileTime($osInfo.InstallTime)
# Saturday, 15 June 2024 7:39:16 PM
Get-CimInstance Win32_OperatingSystem |Select-Object -ExpandProperty InstallDate
# Saturday, 15 June 2024 7:39:16 PM
@jborean93 Using InstallTime
registry value seems good to me.
Thank you! :-)
SUMMARY
I would really appreciate having a
ansible_os_install_date
fact. Managing more than 200 win servers with ansible, things sometimes need to be rolled out to newer servers first, before applying these changes to the older ones.The OS Install date can be determined with:
Get-CimInstance Win32_OperatingSystem |Select-Object -ExpandProperty InstallDate
ISSUE TYPE
COMPONENT NAME
setup