If you are looking for renaming an AD User attributes like the “name”, you may be interested in this article. Of course, you can customize the command line to change other attribute like the “DisplayName” or another one.
Before doing any change, check the AD User name you want to rename
To check it with PowerShell, use the below command line
Get-ADUser "Tameka Reed" | fl name
Now rename the account with the following command line
Hello, in this post we are going to see how to export an Office 365 (Exchange online) mailbox content to a PST file. This process can also be used to search for SharePoint, OneDrive, Teams sites, Office 365 group… content. Now that we have set the scene, we can get started.
Check “Specific location” and select modify to specify the location/mailbox you want to export the content from.
On the next tab, click on “choose users, groups or teams” and specify the mailbox for which you want to export the content to PST.
Select the checkbox and click on Choose, selct Done and on the next tab click on Save to validate your choice.
Save and run to start the content search process.
Give a name to your content search process and click save to start the search.
Once the content search of the mailbox you specified is done, in the menu select Export results.
In the next tab, select the export options according to your need and click on “Export”
The export process has now started, you can see the status in the Exports tab by clicking on the name you gave to your export.
Once the export status is completed, you now can start downloading the result.
Clique on “Copy to clipboard” to copy the “Export secret” and click on “Download the result”. On the next page, enter the Export secret and specify the location where to save the pst file.
Start the downloading process – sorry, my OS is in french version 🙂 . At the end of the downloading, retrieve the pst file in the location you previously specified.
To grant access to a particular folder, use this commandline
Add-MailboxFolderPermission -Identity <Folder Identity> -User <User who needs access> -AccessRights <Type of Access>
To grant read-only access to all the folders, you must apply the previous command to all the folder. The easiest way is to use a loop. I propose you a function to reach that goal.
function Add-PermissionOnAllMailboxFolders {
param (
[Parameter(Mandatory = $true)]
$Identity,
[Parameter(Mandatory = $true)]
$User,
[Parameter(Mandatory = $true)]
[validateSet("Author","Reviewer","Contributor")] #Find complete list of permission on https://docs.microsoft.com/en-us/powershell/module/exchange/add-mailboxfolderpermission?view=exchange-ps
$AccessRights
)
$ExcludeFolders = ":\Top of Information Store",":\Recoverable Items",":\Audits",":\Calendar Logging",":\Deletions",":\DiscoveryHolds",":\Purges",":\SubstrateHolds",":\Versions",":\Sync Issues",":\Yammer Root"
$alias = (Get-Mailbox -Identity $Identity).alias
Add-MailboxFolderPermission "$($alias):\" -User $User -AccessRights $AccessRights
(Get-MailboxFolderStatistics -Identity $alias).Identity | Foreach-object {
$folder = $_.replace("$alias\","$($alias):\")
if ($folder.replace("$alias","") -notin $ExcludeFolders) {
Add-MailboxFolderPermission $folder -User $User -AccessRights $AccessRights
}
}
}
Run the script to load the function and then use the commands below to grant the permissions according to your need
Hello, today I am sharing with you an interesting Office 365 script that I hope will help you. This script will tell you how licenses are assigned to a set of user in your Office 365 tenant : Direct or Inherited ?
My script consists of 2 parts, the first determines License Plans assigned to a user account, the second one dertermines the Licenses paths (Direct or Inherited).
With the function Get-LicensePlan, we know what licenses are assigned to a user based on the SkuId. The following second function Get-LAPATH (Get-LicenseAssingmentPaths) will tell us if the licenses are Direct assigned or Inherited from a group.
Now that everything is set, let’s talk about how to use this script to achieve your goal. Of course, for running this script, you need to have Microsoft Online Services PowerShell installed on your computer (PowerShell Module For Office 365) and a read access permissions on your Office 365 Admin portal to see users configuration, ideally User Management Role.
To see Office 365 license assginment paths for one user
"<UserPrincipalName>" | Get-LAPATH
The user james.bond@acidalien.fr has 3 licenses plans assigned:
FLOW FREE inherited from the license group GRP-FLOW-FREE
FLOW FREE directly assigned
DEVELOPERPACK directly assigned
To see Office 365 license assignment paths for several users
From a Powershell table
"<User1 upn>" ,"<User2 upn>","..." | Get-LAPATH
From a file containing the list of UserPrincipalName :
One day, an Office 365 user asked me why he cannot change his Teams Profile Picture. After a few check, we found that a license option was missing on his Office 365 user account. This user account was missing an Exchange Online license.
So, to enable picture adding to a Teams profile, you need to have an Exchange Online license enabled for this profile. Once it’s done, wait for un while or restart Teams and you will see the “Change picture” option appear.
Did you ever need to find in your Office 365 tenant :
What object is using a specific email address or UserPrincipalName ?
What object is preventing an Active Directory account from syncing because of duplicated email address or UserPrincipalName ?
Where are them located in your tenant : in Users, in Contacts or in Deleted users ?
If yes, this article may help you achieve your goal. Find below how to process. To install the Microsoft Online Service Module for Powershell, please follow the instruction in the paragraph Connect with the Microsoft Azure Active Directory Module for Windows PowerShell of this link :
When you are ready, open a Powershell console and Sign in to your Office 365 tenant with an Admin Account using this command line
Connect-MsolService
Run the below Powershell fonction :
functionGet-ConflictingAttributes {
[Cmdletbinding()]
param (
[Parameter(mandatory=$true)]
[String]$SearchValue
)
$SearchTable = @{}
Write-Host "Searching began :" $(Get-Date) -ForegroundColor Green
#Searching in all ProxyAddressesWrite-Host "Searching User and Guest accounts" $(Get-Date) -ForegroundColor Yellow
$User = Get-MsolUser -All | Where-Object {($_.UserPrincipalName -match $SearchValue) -or ($_.ProxyAddresses -match $SearchValue)}
#Searching in all deleted usersWrite-Host "Searching Deleted accounts" $(Get-Date) -ForegroundColor Yellow
$Del = Get-MsolUser -All -ReturnDeletedUsers | Where-Object {($_.UserPrincipalName -match $SearchValue) -or ($_.ProxyAddresses -match $SearchValue)}
#Searching in contactsWrite-Host "Searching Contacts" $(Get-Date) -ForegroundColor Yellow
$Contact = Get-MsolContact -All | Where-Object {$_.EmailAddress -match $SearchValue}
Write-Host"Searching ended :" $(Get-Date) -ForegroundColor Green
if ($User){
$SearchTable.Add($User.UserType,$User) | Out-Null
}
if ($Del){
$SearchTable.Add($Del.UserType,$Del) | Out-Null
}
if ($Contact){
$SearchTable.Add("Contact",$Contact) | Out-Null
}
return$SearchTable
}
Now, suppose that you want to know which account in your Office 365 tenant is using the email address john.doe@koafric.com, it’ simple, run this command line in the Powershell console you previously opened :