Sunday, 19 January 2014

PowerShell Text formatting for Out Of Office message

PowerShell allows you to embed special characters within the string. These special characters are denoted using escape sequences. Escape sequences begin with the back tick (`), the one next to number 1 key on your keyboard.

`b => Backspace
`r => Carriage return
`n => New line
`t => Tab

Alternatively, if you are using PowerShell ISE, you can use preformatted text variable beginning with @” and ending with “@. In order to make this work, @” has to be the last thing where you define your string variable and “@ has to be on the new line at the end of your text and the first thing on that line. Otherwise it won’t work.
For instance,

$OOFMsg = @”
Thanks for your email.
I am out of office at the moment and will get back to you upon my return.
Regards,
Naw
“@

To Enable the Out of Office message

Unfortunately, the text formatting from PowerShell doesn't work on Exchange Mailboxes. Instead you will have to use html tags to embed line break as below.

$OOFMsg = “Thanks for your email.<br><br>I am out of office at the moment and will get back to you upon my return. <br><br>Regards, <br><br>Naw”

Set-MailboxAutoReplyConfiguration “Naw Awn” –AutoReplyState enabled –ExternalAudience all –ExternalMessage $OOFMsg –InternalMessage $OOFMsg



Out of Office Message begins from tomorrow till the next 3 days

Set-MailboxAutoReplyConfiguration “Naw Awn” –AutoReplyState scheduled –StartTime (Get-Date –uformat “%d/%m/%y”(Get-Date).AddDays(1)) –EndTime (Get-Date –uformat “%d/%m/%y”(Get-Date).AddDays(4)) ExternalAudience all –ExternalMessage $OOFMsg –InternalMessage $OOFMsg

To disable the Out of Office message

Set-MailboxAutoReplyConfiguration “Naw Awn” –AutoReplyState disabled

MS Exchange 2013 PowerShell Cmdlets Collection - Part 3

Sharing and Collaboration Cmdlets

Sharing Cmdlets

Get|New|Remove|Set|Test-OrganiztionRelationshihp
Get|New|Remove|Set-SharingPolicy

Public Folder Cmdlets

Get|New|Remove|Set-PublicFolder
Update-PublicFolderMailbox
Get-PublicFolderMailboxDiagnostics
Get|Set|Disable|Enable-MailPublicFolder
Add|Get|Remove-PublicFolderClientPermission
Get|New|Remove|Set|Suspend|Resume-PublicFolderMigrationRequest
Get-PublicFolderMigrationRequestStatistics
New-MoveRequest
New-PublicFolderMoveRequest
.\Move-PublicFolderBranch.ps1

Site Mailbox Cmdlets

Get|Set|Test|Update-SiteMailbox
Get-SiteMailboxDiagnostic
Get|New|Remove|Set-SiteMailboxProvisioningPolicy

Move and Migration Cmdlets

Get|Set-MigrationConfig
Get|Remove-MigrationUser
Get|New|Set-MigrationEndPoint
Get-MigrationStatistics
Get-MigrationUserStatistics
Get|New|Remove|Set|Start|Stop|Complete-MigrationBatch
Export-MigrationReport
Test-MigrationServerAvailability
Get|New|Remove|Resume|Suspend|Set-MoveRequest
Get-MoveRequestStatistics

Federation and Hybrid Configuration Cmdlets

Federation Cmdlets

Add|Remove-FederatedDomain
Get-FederatedDomainProof
Get|Set-FederatedOrganizationIdentifier
Get-FederationInformation
Get|New|Remove|Set|Test-FederationTrust
Test-FederationTrustCertificate
Get|Set-PendingFederatedDomain

Hybrid Configuration Cmdlets

Get|New|Remove|Set|Update-HybridConfiguration
Get|Set-HybridMailFlow
Get-HybridMailflowDataCenterIPs
Get|New|Remove|Set-OnPremisesOrganization

Monday, 13 January 2014

MS Exchange 2013 PowerShell Cmdlets Collection - Part 2

Email Address & Address Book Cmdlets

Address Book Policy

Get|New|Set|Remove-AddressBookPolicy

Address List

Get|Move|New|Remove|Set|Update-AddrerssList
Disable|Enable-AddressListPaging
Get|Set|Restore-DetailsTemplate
New|Get|Remove|Set|Update-GlobalAddressList

Email Address Policy

Get|New|Remove|Set|Update-EmailAddressPolicy

Offline Address Book

Get|New|Remove|Move|Set|Update-OfflineAddressBook
Get|New|Remove|Set-OabVirtualDirectory

Client Access Cmdlets

Client Access

Get|Set-CasMailbox
New|Remove|Get|Set-WebServicesVirtualDirectory
Get|Set-ClientAccessServer
Test-WebServiceConnectivity
Enable|Disable-ServiceEmailChannel
Get-TextMessagingAccount
Get|Set-RpcClientAccess
Get-ClientAccessArray
Send-TextMessagingVerificationCode

OWA

Get|Set|New|Remove-OwaVirtualDirectory
Get|Set|New|Remove-OwaMailboxPolicy

ActiveSync

Get|Clear|Remove-ActiveSyncDevice
Get|Clear|Remove-MobileDevice
Get|RemoveNew|Set-ActiveSyncVirtualDirectory
Test-ActiveSyncConnectivity
Get-ActiveSyncDeviceStatistics
Get|New|Remove|Set-ActiveSyncMailboxPolicy
Get|New|Remove|Set-MobileDeviceMailboxPolicy
Export-ActiveSyncLog

POP3 & IMAP4

Get|Set-PopSettings
Get|Set-ImapSettings
Test-PopConnectivity
Test-ImapConnectivity

AutoDiscover

Export-AutoDiscoverConfig
New|Remove|Get|Set-AutodiscoverVirtualDirectory
New|Remove|Get|Set-OutlookProvider

Availability

Add|Get|Remove-AvailabilityAddressSpace
Get|Set-AvailabilityConfig

Outlook Anywhere

Get|Set-OutlookAnyWhere

Powershell Virtual Directory

Get|New|Remove|Set-PowershellVirtualDirectory
Test-PowershellConnectivity

High Availability Cmdlets

DAG

Add|Remove-DatabaseAvailabilityGroupServer
Get|New|Remove|Restore|Set|Start|Stop-DatabaseAvailabilityGroup

DAG Network

Get|New|Remove|Set-DatabaseAvailabilityGroupNetwork

Mailbox Database Copy

Add|Remove|Resume|Set|Suspend|Update-mailboxDatabaseCopy
Move-ActiveMailboxDatabase

Health & Status

Get-MailboxDatabaseCopyStatus
Test-ReplicationHealth

Active Directory Cmdlets

Get|Set-AdServerSettings
Get|Set-OrganizationConfig
Get-DomainController
Get-OrganizationalUnit

Server health, Monitoring & Performance Cmdlets

New|Remove|Get|Set-ThrottlingPolicy
Get|Set-ThrottlingPolicyAssociation
New|Remove|Get|Set-ResourcePolicy
New|Remove|Get-WorkloadManagementPolicy
New|Remove|Get|Set-WorkloadPolicy
Get|Set-EventLogLevel
Dump|Reset-ProvisioningCache
Get-MonitoringItemIdentity
Get-ServerHealth
Get|Set-ServerComponentState
Get-MonitoringItemHelp
Get-HealthReport
Add|Get|Remove-GlobalMonitoringOverride
Add|Get|Remove-ServerMonitoringOverride
Invoke-MonitoringProbe

Global Cmdlets

Test-ServiceHealth
Update-ExchangeHelp
Get|Set-ExchangeServer
Get-ExchangeServerAccessLicenseUser
Get-ExchangeServerAccessLicense
Get|Set-ExchangeAssistanceConfig
Get|Set-Notification

Cmdlet Extension Agent

Get|Set|Disable|Enable-CmdletExtensionAgent

Anti-Spam & Anti-Malware Cmdlets

Anti-Malware

Get|Set-MalwareFilteringServer
Get|New|Remove|Set-MalwareFilterPolicy
Disable|Enable-MalwareFilterRule
Get|New|Remove|Set-MalwareFilterRule

Anti-Spam Connection Filter

Get|Set-IPAllowListConfig
Add|Get|Remove-IPAllowListEntry
Add|Get|Remove|Set|Test-IPAllowListProvider
Get|Set-IPAllowLlistProviderConfig
Get|Set-IPBlockListConfig
Add|Get|Remove-IPBlockListEntry
Add|Get|Remove-IPBlockListProvider
Get|Set-IPBlockListProviderConfig

Anti-Spam Content Filter

Get|Set-ContentFilterConfig
Add|Get|Remove-ContentFilterPhrase
Update-SafeList

Recipient Filter

Get|Set-RecipientFilterConfig

Sender Filter

Get|Set-SenderFilterConfig

Sender ID

Get|Set-SenderIdConfig
Test-SenderId

Sender Reputation

Get|Set-SenderReputationConfig

Mailbox Junk Email Configuration

Get|Set-MailboxJunkEmailConfiguration

Anti-Spam & Anti-Malware Management

Get-AgentLog

Saturday, 11 January 2014

MS Exchange 2013 PowerShell Cmdlets Collection - Part 1

Mailbox Related Cmdlets

Server Cmdlets

Get|Set-MailboxServer
Test-MapiConnectivity
Export-MailboxDiagnosticLogs
Test-AssistantHealth

Database Cmdlets

New|Get|Set|Remove-MailboxDatabase
Remove-StoreMailbox
Get-StorageUsageStatistics
Dismount|Mount-Database
Move-DatabasePath
Get-FailedContentIndexDocuments

Other Mailbox Cmdlets

Test-ExchangeSearch
Get-MessageCategory
Search-Mailbox
New|Get|Set|Enable|Disable|Remove-InboxRule

MailFlow Related Cmdlets

Message Tracking Cmdlets

Get-MessageTrackingLog
Get-MessageTrackingReport
Search-MessageTrackingReport

Queue Management Cmdlets


Get|Export|Redirect|Remove|Resume|Suspend-Message
Get|Resume|Retry|Suspend-Queue
Get-QueueDigest
Add|Get|Remove|Set-ResubmitRequest

Delivery Status Notification, DSN, Cmdlet


Get|New|Remove|Set-SystemMessage

Transport Core Cmdlets


Get|Set-AdSite
Get|Set-AdSiteLink
Get|Set-FrontendTransportService
Get|Set-MailboxTransportService
Get-NetworkConnectionInformation
Get|Set-TransportConfig
Get-TransportPipeline
Get|Set-TransportServer
Get|Set-TransportService
Test-MailFlow
Test-SmtpConnectivity

Connector Cmdlets


Get|New|Remove|Set-ReceiveConnector
Get|New|Remove|Set-SendConnector
Get|New|Remove|Set-DeliveryAgentConnector
Get|New|Remove|Set-ForeignConnector

Domain Cmdlets

Get|New|Remove|Set-AcceptedDomain
Get|New|Remove|Set-RemoteDomain
Get|New|Remove|Set-X400AuthoritativeDomain

Edge Cmdlets

Get|New|Remove-EdgeSubscription
Start|Test-EdgeSynchronization
Get|New|Set-EdgeSyncServiceConfig

Transport Agent Cmdlet

Disable|Enable|Get|Install|Set|Unistall-TransportAgent

Recipient Related Cmdlets

Calendar Cmdlets

Get-CalendarDiagnosticLog
Get|Set-CalendarNotification
Get|Set-CalendarProcessing
Test-CalendarConnectivity

Group Cmdlets

Disable|Enable|Get|New|Remove|Set-DistributionGroup
Add|Get|Remove|Update-DistributionGroupMember
Get|New|Remove|Set-DynamicDistributionGroup
Get|Set|-Group –anr (ambiguous name resolution)


Import Export Mailbox Cmdlets


Get|New|Remove|Resume|Set|Suspend-MailboxExportRequest
Get-MailboxExportRequestStatistics
Get|New|Remove|Resume|Set|Suspend-MailboxImportRequest
Get-MailboxImportRequestStatistics

Configuration Cmdlets


Get|Set-MailboxAutoReplyConfiguration
Get|Set-MailboxCalendarConfiguration
Get|Set-MailboxCalendarFolder
Get|New-MailboxFolder
Get|Set-MailboxMessageConfiguration
Get|Set-MailboxRegionalConfiguration
Get|Set-MailboxSpellingConfiguration
Export|Import-RecipientDataProperty

Mailbox, User and Contact Cmdlets

Disable|Enable|Get|New|Remove|Set-App
Get|Set-Contact
New-MailMessage
Connect|Disable|Enable|Get|New|Remove|Set-Mailbox
Disable|Enable-MailboxQuarantine
Disable|Enable|Get|New|Remove|Set-MailContact
Disable|Enable|Get|New|Remove|Set-MailUser
Get|Update-Recipient
Get|Set-ResourceConfig
Get|Set-User
Get|Remove|Set-UserPhoto
Get-UserPrincipalNameSuffix

Mailbox Repair Cmdlet

Get|New|Remove-MailboxRepairRequest

Permission Cmdlets

Add|Get|Remove|Set-MailboxFolderPermission
Add|Get|Remove-MailboxPermission

Reports Cmdlets

Get-MailboxFolderStatistics
Get-MailboxStatistics

Remote Mailbox Cmdlet

Disable|Enable|Get|New|Remove|Set-RemoteMailbox

Restore Mailbox Cmdlets

Get|New|Remove|Resume|Set|Suspend-MailboxRestoreRequest
Get-MailboxRestoreRequestStatistics

Role Based Permission Related Cmdlets

Role Group cmdlets

New|Remove|Get|Set-RoleGroup
Add|Remove|Get|Update-RoleGroupMember

Management Role Cmdlet

Get|New|Remove-ManagementRole

Role Entry Cmdlet

Get|Add|Remove|Set-ManagementRoleEntry

Role Scope Cmdlet

Get|New|Remove|Set-ManagementScope

Role Policy Cmdlet

Get|New|Remove|Set-RoleAssignmentPolicy

Role Assignment Cmdlet

Get|New|Remove|Set-ManagementRoleAssignment

Security Related Cmdlets

Add|Get|Remove-ADPermission
Get|Set-AuthConfig
Get|New|Remove|Set-AuthServer
Enable|Export|Import|Get|New|Remove-ExchangeCertificate
Test-OAuthConnectivity
Get|New|Remove|Set-PartnerApplication
Get-SecurityPrincipal
Get-Trust

Messaging Policy & Compliance Cmdlets

Administrator Audit Log

Get|Set-AdminAuditLogConfig
New-AdminAuditLogSearch
Search-AdminAuditLog

Mailbox Audit Log

New-MailboxAuditLogSearch
Search-MailboxAuditLog

Message Classification

Get|New|Remove|Set-MessageClassification

Data Loss Prevention

Get|New|Remove|Set-ClassificationRuleCollection
Get-DataClassification
Get-DlpPolicy
Export|Import-DlpPolicyCollection
Get|Import|Remove-DlpPolicyTemplate

Transport Rules

Disable|Enable|Get|New|Remove|Set-TransportRule
Get-TransportRuleAction
Export|Import-TransportRuleCollection
Get-TransportRulePredicate

IRM

Get|Set|Test-IRMConfiguration
Disable|Enable|Get|New|Remove|Set-OutlookProtectionRule
Get-RMSTemplate

Journaling

Disable|Enable|Get|New|Remove|Set-JournalRule
Export|Import-JournalRuleCollection

MRM

Get|New|Remove|Set-ManagedContentSettings
Get|New|Remove|Set-ManagedFolder
Start|Stop-ManagedFolderAssistant
Get|New|Remove|Set-MaganedFolderMailboxPolicy
Get|New|Remove|Set-RetentionPolicy
Get|New|Remove|Set-RetentionPolicyTag

In-Place eDiscovery & In-Place Hold

Get|New|Remove|Set|Start|Stop-MailboxSearch