Skip to content

Comments

Disconnect-ZtAssessment: Include All services#917

Merged
merill merged 8 commits intomainfrom
Update-Disconnect-ZTAssessment
Feb 18, 2026
Merged

Disconnect-ZtAssessment: Include All services#917
merill merged 8 commits intomainfrom
Update-Disconnect-ZTAssessment

Conversation

@Manoj-Kesana
Copy link
Collaborator

@Manoj-Kesana Manoj-Kesana commented Feb 18, 2026

🔄 Updated Disconnect-ZtAssessment to Support All Connection Services

Summary

Enhanced Disconnect-ZtAssessment to disconnect from all services that Connect-ZtAssessment can connect to, ensuring complete session cleanup.

Changes

Previously Supported

  • Microsoft Graph (Disconnect-MgGraph)
  • Azure (Disconnect-AzAccount)

Added Support For

  • Exchange Online, Security & Compliance PowerShell* - Disconnect-ExchangeOnline
  • SharePoint Online - Disconnect-SPOService
  • Azure Information Protection - Disconnect-AipService

Implementation

  • ✅ Each service includes proper error handling for missing modules
  • ✅ Uses -Confirm:$false to prevent interactive prompts
  • ✅ Graceful handling with SilentlyContinue and appropriate warnings
  • ✅ Color-coded console output for better user experience
  • ✅ Updated documentation with complete service list

Testing

Test disconnection:

Disconnect-ZtAssessment

Tested Output

image

@Manoj-Kesana Manoj-Kesana self-assigned this Feb 18, 2026
@Manoj-Kesana Manoj-Kesana added the ready for review PR is ready for review and merging label Feb 18, 2026
@alexandair alexandair requested a review from Copilot February 18, 2026 11:29
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Disconnect-ZtAssessment so it cleans up sessions for all services that Connect-ZtAssessment can establish connections to, aiming for more complete session teardown at the end of an assessment run.

Changes:

  • Expanded help text to list additional supported services for disconnection.
  • Added disconnect calls for Exchange Online, Security & Compliance PowerShell, SharePoint Online, and Azure Information Protection.
  • Added per-service try/catch handling and user-facing console/log messages.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Manoj-Kesana and others added 3 commits February 18, 2026 17:06
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Manoj-Kesana Manoj-Kesana marked this pull request as draft February 18, 2026 11:57
@Manoj-Kesana Manoj-Kesana marked this pull request as draft February 18, 2026 11:57
@Manoj-Kesana Manoj-Kesana removed ready for review PR is ready for review and merging labels Feb 18, 2026
@Manoj-Kesana Manoj-Kesana marked this pull request as ready for review February 18, 2026 14:07
@Manoj-Kesana Manoj-Kesana added the ready for review PR is ready for review and merging label Feb 18, 2026
@alexandair alexandair requested a review from gaelcolas February 18, 2026 14:40
Copy link
Collaborator

@merill merill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@merill merill merged commit 8e61833 into main Feb 18, 2026
4 checks passed
aahmed-spec pushed a commit that referenced this pull request Feb 19, 2026
* Disconnect-ZtAssessment: Include All services

* Update src/powershell/public/Disconnect-ZtAssessment.ps1

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/powershell/public/Disconnect-ZtAssessment.ps1

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Addressed copilot feedback

* Merged Exchange and security complaince into one cmdlet

* Error Action - SilentlyContinue

* Add Service and IncludeCleanup parameters

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: alexandair <alexandair@live.com>
@Manoj-Kesana Manoj-Kesana deleted the Update-Disconnect-ZTAssessment branch February 20, 2026 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for review PR is ready for review and merging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants