GET-MAILBOX * | where { $_.PrimarySMTPAddress.Domain -eq ‘kennethdalbjerg.dk’ }
Tag Archives: exchange 2007
Give all users access to all mailbox calendar
foreach ($Mailbox in (Get-Mailbox -ResultSize Unlimited)) { Add-MailboxFolderPermission -identity “$($Mailbox.Name):\calendar” -AccessRights Author -User default }
Powershell – Export user/mailboxes to CSV file
get-mailbox | select name, alias, samaccountname, RecipientType, RecipientTypeDetails, displayname | export-csv C:\ITA\usersexport.csv -encoding unicode
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`
}
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
Powershell – Show witch users have access to mailboxes
$file = “C:\ita\fulladgang.txt”
$AllUsers = get-mailbox | select SamAccountName, name, alias
$AllUsers | Foreach {
echo “”
echo “”
echo “”
echo $_.name
get-mailboxfolderpermission -identity $Mailbox
} | out-File $File
Powershell get all users with title = “Interneservices” – Search on title on get-user
get-user -filter {Title -eq “InterneServices”} | select name
Powershell – Get Mailbox permission search on title = InterneServices
$File = “C:\ita\fulldadgang-services.txt”
$AllUsers = get-user -filter {Title -eq “InterneServices”} | select name
$AllUsers | Foreach {
echo “”
echo “”
echo “”
echo $_.name
Get-MailboxPermission -identity $_.name
} | out-File $File
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
howto export mailbox size to CSV file Exchange 2007/2010
Howto Export all mailbox’es and there size to a CSV file
get–mailbox | get-mailboxstatistics | select-object DisplayName,TotalItemSize,StorageLimitStatus,LastLogonTime | Export-Csv c:\exchange.csv