PowerShell Extract the Immutable ID for an Office 365 user There are many reasons why you may need this value and in my case its for Okta. Connect to O365 and substitute the username for the user required: Get-MsolUser -UserPrincipalName "username@domain.com" | Select-Object ImmutableID
Office365 Litigation Hold - Recoverable Items quota Placing a mailbox on an indefinite hold means that mail items meeting the hold requirements will never be removed from the mailbox. This can result in the mailbox exceeding the Recoverable Items Quota, which could make the mailbox unusable or have strange errors (getting meeting invites for example). Location of
Office365 Connect to Office365 If you haven't done this already you need to install the necessary modules: Install-Module MSOnline This is the snippet of code I usually run to quickly connect to O365. function Connect-O365 { $UserCredential = Get-Credential -UserName "username@domain.eu" -Message "Username has to be in the format
Office365 Discrepancy in Outlook Desktop and OWA for Shared Mailboxes If an incoming email is flagged with "Sensitivity: Private" then due to how Microsoft define permissions these emails won't be visible to all users in a shared mailbox. If you are not the owner of the mailbox then you need to do this via OWA. Select
Office365 Create "Room Lists" of meeting rooms in Exchange Connect to Office 365 [https://www.lackofpotatoes.co.uk/connect-to-office365/]: Build a variable with all the rooms you want to include in the list: $RoomAlias = Get-Mailbox -RecipientTypeDetails RoomMailbox -Filter {Name -like '*<name>*'} | select -ExpandProperty Alias Create new DistributionGroup as a RoomList and add your rooms as
Office365 Find user based on SIP address Connect to Office 365 [https://www.lackofpotatoes.co.uk/connect-to-office365/]: Get-ADUser -filter * -Properties msRTCSIP-PrimaryUserAddress | where msRTCSIP-PrimaryUserAddress -eq "sip:simon@domain.eu"
Office365 Re-link a mailbox to a user Connect to Office 365 [https://www.lackofpotatoes.co.uk/connect-to-office365/]: Undo-SoftDeletedMailbox <email address of mailbox> -WindowsLiveID <email address of mailbox> -Password (ConvertTo-SecureString -String '<any password that meets the policy>' -AsPlainText -Force) It's best to NOT do this and just remove
Office365 Find a user by its email Alias Connect to Office 365 [https://www.lackofpotatoes.co.uk/connect-to-office365/]: In this example any user that has a domain.eu email addresses: Get-Mailbox -Identity * | Where-Object {$_.EmailAddresses -like 'smtp:*@domain.eu'} | Format-List Identity, EmailAddresses
Office365 Clear User photo Connect to Office 365 [https://www.lackofpotatoes.co.uk/connect-to-office365/]: Remove-UserPhoto "<users full name>" -ClearMailboxPhotoRecord
Office365 Add permissions to a mailbox Connect to Office 365 [https://www.lackofpotatoes.co.uk/connect-to-office365/]: Add-MailboxPermission -Identity "<full name of mailbox owner>" -User "<full name of user you want to grant permissions>" -AccessRights FullAccess -InheritanceType All
Office365 Set a shared mailbox to also store sent emails within it self Connect to Office 365 [https://www.lackofpotatoes.co.uk/connect-to-office365/]: set-mailbox <mailbox name> -MessageCopyForSendOnBehalfEnabled $true set-mailbox <mailbox name> -MessageCopyForSentAsEnabled $true
Office365 Update Calendar entries to show subject and organisers name Connect to Office 365 [https://www.lackofpotatoes.co.uk/connect-to-office365/]: Set-CalendarProcessing -Identity <room email address> -DeleteSubject $False -AddOrganizerToSubject $False
Office365 Set work hours/timezone for Resource Rooms Connect to Office 365 [https://www.lackofpotatoes.co.uk/connect-to-office365/]: Set-MailboxCalendarConfiguration -Identity "<room name>" -WorkingHoursStartTime <start time> -WorkingHoursEndTime <end time> -WorkingHoursTimeZone "<timezone>" Live example: Set-MailboxCalendarConfiguration -Identity "Conf Room_One" -WorkingHoursStartTime 07:00:00 -WorkingHoursEndTime 20:00:
Office365 How to Permanently Remove Deleted Users from Office365 Objects will age off after 30 days but sometimes you need them gone sooner. Connect to Office 365 [https://www.lackofpotatoes.co.uk/connect-to-office365/]: Get list of users that have been removed: Get-MsolUser -ReturnDeletedUsers Remove the user/mailbox in question: Remove-MsolUser -UserPrincipalName <user email> -RemoveFromRecycleBin