Skip to content

Conversation

@ojopiyo
Copy link

@ojopiyo ojopiyo commented Dec 11, 2025

  1. Modular Functions - Get-AllUsersFromUPA, Get-DisabledUsersFromGraph, and Validate-SiteUsers encapsulate logic for clarity and reusability.

  2. Readable Loops - Flattened loops and replaced nested if logic with clear conditions.

  3. Pipeline-Friendly - Uses ForEach-Object and -contains for clean collection handling.

  4. Error Handling - Each user retrieval is wrapped in try/catch to prevent the script from stopping.

  5. Color-Coded Output - Yellow for warnings, Red for errors, Green for completion.

  6. Easy to Extend - Adding additional validation rules is straightforward within Validate-SiteUsers.

1. Modular Functions - Get-AllUsersFromUPA, Get-DisabledUsersFromGraph, and Validate-SiteUsers encapsulate logic for clarity and reusability. 2. Readable Loops - Flattened loops and replaced nested if logic with clear conditions. 3. Pipeline-Friendly - Uses ForEach-Object and -contains for clean collection handling. 4. Error Handling - Each user retrieval is wrapped in try/catch to prevent the script from stopping. 5. Color-Coded Output - Yellow for warnings, Red for errors, Green for completion. 6. Easy to Extend - Adding additional validation rules is straightforward within Validate-SiteUsers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant