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
}
}
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
- 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...