Skip to content

System cannot find the file specified #3

@han44-illinois

Description

@han44-illinois

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions