Monday 16 July 2012

PowerSell Command(Exchange2010)

Get-Mailbox -ResultSize Unlimited |  select DisplayName, Alias, Database, PrimarySmtpAddress,@{name=’IssuewarningQuota’;expression={if ($_.IssueWarningQuota -match “UNLIMITED”) {“-1″} else {$_.IssueWarningQuota.value.tomb() }}},@{name=’ProhibitSendQuota’;expression={if ($_.ProhibitSendQuota -match “UNLIMITED”) {“-1″} else {$_.ProhibitSendQuota.value.tomb() }}},@{name=’ProhibitSendReceiveQuota’;expression={if ($_.ProhibitSendReceiveQuota -match “UNLIMITED”) {“-1″} else {$_.ProhibitSendReceiveQuota.value.tomb() }}},WhenCreated  |export-csv C:\stats.csv
“DisplayName,Alias,MailboxSizeMB,ItemCount,PrimarysmtpAddress,IssueWarningQuotaMB,ProhibitSendQuotaMB,ProhibitSendReceiveQuotaMB,DatabaseName,CreationDate,LastLogonTime,LastLogoffTime,isActive” | out-file C:\MailstatsResult.csv

Get-MailboxStatistics -server "server" | Sort -Property TotalItemsize | Format-Table DisplayName, LastLoggedOnUserAccount, ItemCount, @{expression={$_.totalitemsize.value.ToMB()};label=”Size(MB)”}, LastLogonTime, LastLogoffTime | Export-CSV c:\test13.csv

Get-Mailbox -ResultSize Unlimited |  select DisplayName, Alias, Database, PrimarySmtpAddress

Get-MailboxStatistics -server "server"  |  select DisplayName, Alias, Database, PrimarySmtpAddress

Get-Mailbox -ResultSize Unlimited |  select DisplayName,Alias,MailboxSizeMB,ItemCount,PrimarysmtpAddress,IssueWarningQuotaMB

Get-Mailbox | Get-MailboxFolderStatistics | Select Identity,FolderPath,FolderSize,ItemsInFolder | Sort-Object ItemsInFolder | fl

Add-MailboxPermission testmbx -AccessRights FullAccess -user jaredz
Set-Mailbox testmbx -GrantSendOnBehalfTo jaredz
Add-ADPermission testmbx -ExtendedRights Send-As -user jaredz
Add-ADPermission user -User “DomainB\User” -Extendedrights “Send As”
“Set-Mailbox “USER” -GrantSendOnBehalfTo “DomainB\User”
Get-Globaladdresslist | update-Globaladdresslist
Get-Addresslist | Update-Addresslist
Add-MailboxFolderPermission -Identity marry:\Calendar -User harry -AccessRights Reviewer
Get-MailboxFolderStatistics -Identity marry
Get-MailboxFolderPermission -Identity marry:\Calendar
Get-MailboxFolderStatistics -Identity marry -FolderScope Calendar | Select-Object -First 1).Name
Get-MailboxFolderPermission -Identity marry:\Calendar
Set-MailboxFolderPermission -Identity marry:\Calendar -User harry -AccessRights Owner
Get-MailboxFolderPermission -Identity marry:\Calendar
Set-MailboxFolderPermission -Identity marry:\inbox -User harry -AccessRights Owner
Set-MailboxFolderPermission -Identity marry:\task -User harry -AccessRights Owner
Set-MailboxFolderPermission -Identity marry -User harry -AccessRights Owner
Update-Calendarpermission -identity marry -User harry -Permission ReadItems
Set-MailboxFolderPermission -Identity LasseP:\Calendar -User Eva -AccessRights Owner
Add-MailboxFolderPermission -Identity LasseP:\Calendar -User Eva -AccessRights Reviewer
Get-MailboxFolderPermission -Identity LasseP:\Calendar
Get-MailboxStatistics -server serverhere | Where-Object {$_.DisplayName -like "*MailboxUserName*"} | Format-Table DisplayName,ItemCount,TotalItemSize
Get-Mailbox -Database "Db3" -ResultSize Unlimited |Set-Mailbox -RecipientLimits 5
new-mailboxdatabase -Server 'ggncloud' -Name 'db3' -EdbFilePath 'E:\Exch2010-DBs\<DATABASE NAME>\db3.edb' -LogFolderPath 'E:\Exch2010-Logs\db3'
Mount-Database -Identity "db3"
Set-MailboxDatabase -ProhibitSendReceiveQuota '45Mb' -ProhibitSendQuota '40Mb' -IssueWarningQuota '35Mb' -RetainDeletedItemsUntilBackup $true -Identity "db3"
Set-MailboxDatabase -OfflineAddressBook '\Default Offline Address Book' -Identity "db3"
New-GlobalAddressList -Name "gal" -RecipientFilter {(MemberOfGroup -eq 'cn=<GROUP NAME>,OU=Exchange Groups,DC=ggncloud,DC=internal')}
Update-GlobalAddressList -Identity "gal"
Add-ADPermission -Identity $dngal -User "gal" -AccessRights extendedright -ExtendedRights "open address list" -Deny:$True
get-mailbox -ResultSize Unlimited
get-powersellvirtualdirectory
get-ActiveSyncMailboxPolicy

Get-MailboxDatabase -Status | Sort-Object name | Format-Table Name, DatabaseSize, AvailableNewMailboxSpace
Get-MailboxDatabase -Identity databasename -Status | Format-Table Name, DatabaseSize, AvailableNewMailboxSpace
New-ManagementRoleAssignment -Role "Mailbox Import Export" -User administrator
Get-MailboxDatabase | Set-MailboxDatabase -OfflineAddressBook "\Default Offline Address Book"
Get-ExchangeServer | FT Name,ServerRole -auto
Get-Mailbox | Get-MailboxStatistics -Server ggncloud | Sort-Object TotalItemSize -Descending | Format-Table DisplayName,ItemCountTotalItemsize
Get-MailboxStatistics "Clayton Kamiya" | FT DisplayName, ItemCount,TotalItemSize
Get-Mailbox | Select Name, ProhibitSendQuota, ProhibitSendReceiveQuota | Export-Csv c:\report.csv
Get-MailboxDatabase -IncludePreExchange2010
ServerManagerCMD -i RPC-over-HTTP-Proxy
Set-OwaVirtualDirectory "ggncloud\owa (Default Web Site)" -ExternalURL $Null
Get-MailboxDatabaseCopyStatus | Format-List Name,Status,LastInspectedLogTime,ContentIndexState
Get-MessageTrackingLog | Format-table EventID,Source,Sender, MessageSubject
Test-WebServicesConnectivity
get-transportserver | fl *Log*
ServerManagerCmd -i Backup-Features
Import-Module Servermanager
Add-WindowsFeature Backup-Features
Servermanagercmd -query
Get-ExCommand *mailbox*
Get-LogonStatistics -Server ggncloud
test-replicationhelth

No comments:

Post a Comment