[GH-ISSUE #2121] [Feature Request]: User off-boarding additional options #1084

Closed
opened 2026-03-02 13:41:26 +03:00 by kerem · 2 comments
Owner

Originally created by @SGeeves on GitHub (Feb 9, 2024).
Original GitHub issue: https://github.com/KelvinTegelaar/CIPP/issues/2121

Description of the new feature - must be an in-depth explanation of the feature you want, reasoning why, and the added benefits for MSPs as a whole.

In the user off-boarding section there is a great selection of tasks which really aid in the off-boarding process. I love this.

We have found over the years, with hundreds/thousands or user off-boarding tasks that the following are really helpful for visibility of user accounts after the fact.

The addition of prepending or changing the users display name as part of the off-boarding would be great, we typically use the phrase "Archive - DisplayName.

Also the potential addition of the ability to move a users email alias(es) to another user account. We have found with companies with high staff turnover, that the use of email forwarding can get extremely messy very fast. With the ability to move user aliases, this removes this confusion as it is searchable and doesn't get missed.

PowerShell commands you would normally use to achieve above request

#Gets the users information
$User = Get-MGUser | where -property UserPrincipalName -eq "%UPN%"
$UserPrincipalNameNew = "Archive." + $User.UserPrincipalName
$UserPrincipalName = $User.UserPrincipalname

#Changes the users UPN to prefix
Update-MGUser -UserId $User.Id -UserPrincipalName $UserPrincipalNameNew
start-sleep -seconds 15

#Changes the primary SMTP address to preix
set-mailbox -identity $UserMailboxID -EmailAddresses "SMTP:$UserPrincipalNameNew"
start-sleep -seconds 15

#Gets array of user aliases
$UserAliases3 = Get-Mailbox -Identity $UserMailboxID | Select-Object -ExpandProperty emailaddresses alias
$UserAliases2 = $UserAliases3 | Select-String -SimpleMatch 'smtp:'
$UserAliases1 = $UserAliases2 | Select-String -NotMatch 'onmicrosoft.com'
$UserAliases = $UserAliases1 -replace ".*:"

#Removes the aliases from the user
set-mailbox -identity $UserMailboxID -EmailAddresses @{Remove=$UserAliases}
start-sleep -seconds 15

#Adds the aliases to the specified user
set-mailbox -identity $AddUserMailboxID -EmailAddresses @{Add=$UserAliases}

Originally created by @SGeeves on GitHub (Feb 9, 2024). Original GitHub issue: https://github.com/KelvinTegelaar/CIPP/issues/2121 ### Description of the new feature - must be an in-depth explanation of the feature you want, reasoning why, and the added benefits for MSPs as a whole. In the user off-boarding section there is a great selection of tasks which really aid in the off-boarding process. I love this. We have found over the years, with hundreds/thousands or user off-boarding tasks that the following are really helpful for visibility of user accounts after the fact. The addition of prepending or changing the users display name as part of the off-boarding would be great, we typically use the phrase "Archive - *DisplayName*. Also the potential addition of the ability to move a users email alias(es) to another user account. We have found with companies with high staff turnover, that the use of email forwarding can get extremely messy very fast. With the ability to move user aliases, this removes this confusion as it is searchable and doesn't get missed. ### PowerShell commands you would normally use to achieve above request #Gets the users information $User = Get-MGUser | where -property UserPrincipalName -eq "%UPN%" $UserPrincipalNameNew = "Archive." + $User.UserPrincipalName $UserPrincipalName = $User.UserPrincipalname #Changes the users UPN to prefix Update-MGUser -UserId $User.Id -UserPrincipalName $UserPrincipalNameNew start-sleep -seconds 15 #Changes the primary SMTP address to preix set-mailbox -identity $UserMailboxID -EmailAddresses "SMTP:$UserPrincipalNameNew" start-sleep -seconds 15 #Gets array of user aliases $UserAliases3 = Get-Mailbox -Identity $UserMailboxID | Select-Object -ExpandProperty emailaddresses alias $UserAliases2 = $UserAliases3 | Select-String -SimpleMatch 'smtp:' $UserAliases1 = $UserAliases2 | Select-String -NotMatch 'onmicrosoft.com' $UserAliases = $UserAliases1 -replace ".*:" #Removes the aliases from the user set-mailbox -identity $UserMailboxID -EmailAddresses @{Remove=$UserAliases} start-sleep -seconds 15 #Adds the aliases to the specified user set-mailbox -identity $AddUserMailboxID -EmailAddresses @{Add=$UserAliases}
kerem 2026-03-02 13:41:26 +03:00
Author
Owner

@KelvinTegelaar commented on GitHub (Feb 9, 2024):

Only sponsors can create frs.

<!-- gh-comment-id:1935199784 --> @KelvinTegelaar commented on GitHub (Feb 9, 2024): Only sponsors can create frs.
Author
Owner

@SGeeves commented on GitHub (Feb 9, 2024):

I am a sponsor as I understand...

<!-- gh-comment-id:1935350685 --> @SGeeves commented on GitHub (Feb 9, 2024): I am a sponsor as I understand...
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/CIPP#1084
No description provided.