You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure what the cause of this is, but it seems worth noting.
On some systems when this module is run, a profile set for deletion returns the following error (including Loud outputs for additional context:
[2022-04-06 17:53:50:4755] Profile deleted.
[2022-04-06 17:53:50:4755] Time taken to delete: "00:00:00.0099937"
[2022-04-06 17:53:50:4755] Processing profile: ""...
[2022-04-06 17:53:50:4755] Current estimated deletion time: "00:01:00"
[2022-04-06 17:53:50:4755] Time left before timeout: "04:59:25.8857125"
[2022-04-06 17:53:50:4855] Looks like there's probably enough time for at least one more deletion.
[2022-04-06 17:53:50:4855] Deleting profile...
Remove-CIMInstance : The system cannot find the file specified.
At C:\engrit\scripts\Remove-LocalUserProfiles.psm1:176 char:21
+ $profile | Remove-CIMInstance
+ ~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Win32_UserProfi...14-32608244...):CimInstance) [Remove-CimInstance], CimException
+ FullyQualifiedErrorId : HRESULT 0x80070002,Microsoft.Management.Infrastructure.CimCmdlets.RemoveCimInstanceCommand
Unfortunately it's not consistent across the lab I'm running this on, so I'm unsure if this is a case where the user's profile folder is already missing when the script is run or some other issue.
The text was updated successfully, but these errors were encountered:
Ah actually I just noticed, the line stating "Processing profile" appears to have a blank name for the profile it is attempting to delete. Perhaps the method used to populate this list is picking up nameless profiles somehow?
Hmm, yeah I dunno. The method it uses to get profiles is $profiles = Get-CIMInstance -ClassName "Win32_UserProfile" -OperationTimeoutSec 300. So it would depend on what that's returning. I can see that maybe it would return corrupt profiles, or maybe it's timingout and getting partial data, or something. If you want, you could try running that line on a machine that has the issue and take a glance through what it returns. If we figure it out it would be fairly easy to add a quick check to skip profiles that are broken in whatever way these offending profiles are.
I'm not sure what the cause of this is, but it seems worth noting.
On some systems when this module is run, a profile set for deletion returns the following error (including Loud outputs for additional context:
Unfortunately it's not consistent across the lab I'm running this on, so I'm unsure if this is a case where the user's profile folder is already missing when the script is run or some other issue.
The text was updated successfully, but these errors were encountered: