mirror of
https://github.com/KelvinTegelaar/CIPP.git
synced 2026-04-25 16:26:09 +03:00
[GH-ISSUE #2121] [Feature Request]: User off-boarding additional options #1084
Labels
No labels
API
Feature
NotABug
NotABug
Planned
Sponsor Priority
Sponsor Priority
bug
documentation
duplicate
enhancement
needs more info
no-activity
no-priority
not-assigned
pull-request
react-conversion
react-conversion
roadmap
security
stale
unconfirmed-by-user
unconfirmed-by-user
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/CIPP#1084
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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}
@KelvinTegelaar commented on GitHub (Feb 9, 2024):
Only sponsors can create frs.
@SGeeves commented on GitHub (Feb 9, 2024):
I am a sponsor as I understand...