How Can I Safely Test an FSLogix Profile Cleanup Script?

0
1
Asked By MellowPine47 On

I'm developing a PowerShell script to clean up FSLogix profiles stored in an Azure file share. Before running it in production, I want to verify that it correctly identifies inactive, disabled, and deleted-user profiles without removing anything unexpectedly. I don't currently have a separate share containing realistic inactive and active profiles, so I'm looking for practical ways to build a representative test environment and validate the script safely.

3 Answers

Answered By BrightCedar82 On

Create a separate Azure file share and populate it with test folders and empty VHDX files that match the naming and directory structure used in production. You can script the setup so the test data covers active users, stale profiles, disabled accounts, and deleted users. Run the cleanup against that share first, and consider adding Pester tests so future script changes are checked automatically.

Answered By QuietLantern6 On

Add PowerShell’s ShouldProcess support to the script so it works with `-WhatIf` and `-Confirm`. Also include detailed logging of every profile the script evaluates and the action it would take. That lets you review the planned deletions without actually changing the share, then compare the output with your expectations before enabling destructive behavior.

Answered By SilverMaple31 On

Define the cleanup rules explicitly and test each one separately. For example, you might remove profiles that have not been accessed for three months, profiles belonging to users disabled for at least three months, and profiles for accounts that no longer exist. Make sure those retention periods are approved by the business before putting the cleanup into production.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

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