< Back

Get-LaMailboxRetentionPolicy

Sun Jan 19, 2020 6:27 pm

NAME Get-LaMailboxRetentionPolicy



SYNOPSIS

Reports on which retention policy a mailbox or mailboxes have.





SYNTAX

Get-LaMailboxRetentionPolicy [-list] <String[]> [<CommonParameters>]





DESCRIPTION

Reports on which retention policy a mailbox or mailboxes have. Mailbox UPNs should be passed from the pipeline as

demonstrated in the examples below.



Individual mailboxes, all mailboxes, all mailboxes in a department are all possibilities.



Also demonstrated in an example below is importing mailboxes (UPNs) from a CSV





PARAMETERS

-list <String[]>

{{UPNs passed from the pipeline}}



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByPropertyName, ByValue)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES









-------------------------- EXAMPLE 1 --------------------------



Get-Mailbox -ResultSize unlimited | Select UserPrincipalName | Get-LaMailboxRetentionPolicy | Out-GridView





-------------------------- EXAMPLE 2 --------------------------



Get-Mailbox -ResultSize unlimited | Select UserPrincipalName | Get-LaMailboxRetentionPolicy | Export-Csv

.\\retentionpolicyofmailboxes.csv -NoTypeInformation





-------------------------- EXAMPLE 3 --------------------------



Import-Csv .\\upns.csv | Get-LaMailboxRetentionPolicy | Export-Csv .\\ListofMailboxesandtheirRetentionPolicy.csv

-NoTypeInformation





-------------------------- EXAMPLE 4 --------------------------



Get-MsolUser -All -Department 'Human Resources' | Select UserPrincipalName | Get-LaMailboxRetentionPolicy |

Export-Csv .\\HRdeptRetentionPolicy.csv -NoTypeInformation





-------------------------- EXAMPLE 5 --------------------------



A CSV could look like this



UserPrincipalName

user01@contoso.com

user02@contoso.com







RELATED LINKS