6 thoughts on “FSLogix Containers Cleanup Script

  1. Hi Jeroen,

    Thank you for this script. We are not using FSLogix Flip Flop, but I can’t figure out what to change about the script to make it work. Could you help me with this?

    Kind regards,

    1. Ahh you are the one in a thousand which is not using flip flop 😉 You need to change the script so it reads the username from the last part of the foldername. I never ever use that kind of naming convention as it is not easy to find the user his profile.

  2. This script looks amazing and exactly what I have been trying to build myself. When I try and run it in my environment I am getting the following error:

    Exception calling “Substring” with “2” argument(s): “Length cannot be less than zero.
    Parameter name: length”
    At line:58 char:5
    + $UserName = $pathItem.Name.Substring(0, $PathItem.Name.IndexOf(‘_ …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : ArgumentOutOfRangeException

    Get-ADUser : Cannot validate argument on parameter ‘Identity’. The argument is null. Provide a valid value for the argument, and then try running the command again.
    At line:60 char:45
    + $Information = Get-ADUser -Identity $UserName -Properties sAM …
    + ~~~~~~~~~
    + CategoryInfo : InvalidData: (:) [Get-ADUser], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.ActiveDirectory.Management.Commands.GetADUser

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Related Posts

Begin typing your search term above and press enter to search. Press ESC to cancel.

Back To Top