I have a PowerShell script that is scheduled to trigger every 30 minutes. I have noticed that sometimes it works and sometimes it does not work.
When it does not work I see two event message one in the application log that is 1530 for User Profile Service:
Windows detected your registry file is still in use by other applications or services. The file will be unloaded now. The applications or services that hold your registry file may not function properly afterwards. No user action is required.
DETAIL -
3 user registry handles leaked from \Registry\User\S-1-5-21-2705007612-1783374947-2115659154-1391_Classes:
Process 3680 (\Device\HarddiskVolume4\Windows\System32\WindowsPowerShell\v1.0\powershell.exe) has opened key \REGISTRY\USER\S-1-5-21-2705007612-1783374947-2115659154-1391_CLASSES
Process 3680 (\Device\HarddiskVolume4\Windows\System32\WindowsPowerShell\v1.0\powershell.exe) has opened key \REGISTRY\USER\S-1-5-21-2705007612-1783374947-2115659154-1391_CLASSES
Process 3680 (\Device\HarddiskVolume4\Windows\System32\WindowsPowerShell\v1.0\powershell.exe) has opened key \REGISTRY\USER\S-1-5-21-2705007612-1783374947-2115659154-1391_CLASSES
And Error 103 in the Windows PowerShell log:
Settings: Could not read key from registry (Exception from HRESULT: 0x80040150 (REGDB_E_READREGDB))
Details:
ExceptionClass=COMException
ErrorCategory=
ErrorId=
ErrorMessage=Could not read key from registry (Exception from HRESULT: 0x80040150 (REGDB_E_READREGDB))
Severity=Error
SequenceNumber=
HostName=ConsoleHost
HostVersion=4.0
HostId=ca5012f3-3817-4550-a22f-64e63a5d653f
HostApplication=
EngineVersion=4.0
RunspaceId=cae95f53-8727-433e-93fa-8c770e4af4b5
PipelineId=
CommandName=
CommandType=
ScriptName=
CommandPath=
CommandLine=
AdditionalInfo:
Name=;Value=
Name=;Value=
Out of 20 possible runs this set of events occurs 8 times in a 10 hour window. any suggestions would be great.
Thanks,