Archive

Archives pour 14/01/2010

Souvenir de Hardcore Gamer

Un p’tit plaisir.

Au bon souvenir de la XFrX Team.

ExFrX

Categories: Divers Tags: , , ,

Exporter les MailContacts.

Export des MailContacts.

?View Code POWERSHELL
 
$resfile = New-Item -ItemType file -Path liste_external_contacts.csv -Force
 
Add-Content -Path $resfile -Value "MailContactDisplayName,MailcontactAlias,MailcontactOrganizationalUnit,MailcontactExternalEmailAddress"
 
Get-MailContact -ResultSize unlimited | ForEach-Object {
 
	Add-Content -Path $resfile -Value "$($_.DisplayName),$($_.alias),$($_.OrganizationalUnit),$($_.ExternalEmailAddress)"
 
}
Categories: Exchange 2007 Tags: ,

Exporter les boites avec forwards.

Export des boites aux lettres qui ont des forwards actifs.

?View Code POWERSHELL
$resfile = New-Item -ItemType file -Path liste_forwards.csv -Force
 
Add-Content -Path $resfile -Value "MailboxDisplayName,MailboxAlias,MailContactDisplayName,MailcontactOrganizationalUnit,MailcontactExternalEmailAddress"
 
 
get-mailbox -ResultSize unlimited | Where-Object { $_.ForwardingAddress -ne $null } | ForEach-Object { 
$forward = Get-Recipient -Identity $_.ForwardingAddress
	if ( $forward.RecipientType -eq "MailContact") {
	$mailc = Get-MailContact -Identity $forward.alias
	Add-Content -Path $resfile -Value "$($_.name),$($_.alias),$($mailc.displayname),$($mailc.OrganizationalUnit),$($mailc.ExternalEmailAddress)"
	}
	else {}
 
}