Tagged: exchange 2007

0

Powershell – Import users from CSV file

import-csv user.csv | foreach-object { echo $_.Displayname New-Mailbox -name ( $_.Name) -Alias $_.Alias -SamAccountName $_.SamAccountName -RecipientType $_.RecipientType -RecipientTypeDetails $_.RecipientTypeDetails -Displayname $_.Displayname } Share this:

0

Powershell – Show all users in DistributionGroup

$File = “C:\ita\groupslog.txt” $Mailboxes = Get-DistributionGroup | select name , alias ,displayname,EmailAddresses $Mailboxes | ForEach { echo “” echo “” echo $_.name Get-DistributionGroupMember -id $_.alias } | out-File $File Share this:

0

Powershell – Get-DistributionGroup with all email addressess

$File = “C:\ita\groupslog.txt” Get-DistributionGroup | select name , alias ,displayname,EmailAddresses | foreach { “Name: “+$_.name “Alias: “+$_.alias “Displayname“ +$_.displayname $_.EmailAddresses | foreach { if($_.SmtpAddress){ “SmtpAddress: “+$_.SmtpAddress } } } | out-File $File Share this: