Forum Discussion
Issue with date modified for NTUSER.DAT
- Feb 23, 2018
Here is the code from the script:
#Purpose: Used to set the ntuser.dat last modified date to that of the last modified date on the user profile folder.
#This is needed because windows cumulative updates are altering the ntuser.dat last modified date which then defeats
#the ability for GPO to delete profiles based on date and USMT migrations based on date.$ErrorActionPreference = "SilentlyContinue"
$Report = $Null
$Path = "C:\Users"
$UserFolders = $Path | GCI -DirectoryForEach ($UserFolder in $UserFolders)
{
$UserName = $UserFolder.Name
If (Test-Path "$Path\$UserName\NTUSer.dat")
{
$Dat = Get-Item "$Path\$UserName\NTUSer.dat" -force
$DatTime = $Dat.LastWriteTime
If ($UserFolder.Name -ne "default"){
$Dat.LastWriteTime = $UserFolder.LastWriteTime
}
Write-Host $UserName $DatTime
Write-Host (Get-item $Path\$UserName -Force).LastWriteTime
$Report = $Report + "$UserName`t$DatTime`r`n"
$Dat = $Null
}
}
Thanks for your reply.
Do you know the KB concerned ?
(We have W10 1903 build 18362)
This would have been in October 20, 2020—KB4580386 (OS Builds 18362.1171 and 18363.1171) Preview (microsoft.com)
So last October.
- Patrick BurwellMay 04, 2022Copper Contributorwrong thread. This si the thread for "Issue with date modified for NTUSER.DAT"
- Christopher CurrivanMar 28, 2022Copper Contributor
dylanrafferty-scott - I wonder if "Shared PC" is using, basically, the same policies?! Have you tried "Shared PC" with your 21H1, instead? I still think there is a connection to Anti-Virus/Anti-Malware scans listing the latest access to the profile as when the nightly scan occurred...
- dylanrafferty-scottNov 09, 2021Copper ContributorIs there an update for this? We are running 21H1 and it is still not working.
- AmiDCSOct 29, 2021Copper Contributor
Hello Darrel,
Many thanks about the KB458038 ; )
Could you please tel me if MS have a KB for Windows 10 1703 build 15063.1596 ?
Regards.
Alexandre
- AmiDCSSep 01, 2021Copper ContributorHello Darell,
We have tested the fix on many computers Windows 10 (build 18362).
Now the cleanup of old profiles work perfectly after a restart.
Thanks for your help ; ) - Ami74Jun 24, 2021Copper ContributorThanks Darell for this link ; )
I will try to install this KB in one computer concerned and check if the cleanup profile work after a restart.