Wednesday, October 14, 2009

Exchange 2007 : Common Commands

Here are some common command used in exchange server 2007:-


Help
get-help
get-help verb/noun -detailed

User Objects
get-user sort-object name
get-user Measure-Object
get-user sort-object name -descending
get-user "name" format-list
get-user where-object {$_.distinguishedname -ilike '*ou=sales,dc=domain,dc=com'} Enable-mailbox -database 'servername\databasename'
get-user -filter {(recipienttype - eq 'user') - and (city -eq 'cityname')}

Recipients
enable-mailuser -identity name -externalemailaddress name@domain.com
enable-mailbox "displayname" -database "storagegroup\database"
set-mailbox name -hiddenfromaddresslistsenabled $true/$false -prohibitsendquota unlimited -primarysmtpaddress "name@domain.com"
new-mailbox -userprincipalname "name@domain.com" -alias name -database "name" -name name -organizationalunit name -Firstname name -lastname name -displayname "first last"
get-mailbox -database "server\database"
move-mailbox name -targetdatabase "server\database"
add-mailboxpermission name -user name -accessrights fullaccess
new-distributiongroup -name "name" -organizationalunit "name" -samacccountname "name" -type "security"
set-distributiongroup name -hiddenfromaddresslist $true
new-mailcontact -name "display name" -externalsmtpaddress "name@domain.com" -organizationalunit contractors
set-contact "name" -company "name"
enable-mailcontact "name" -externalemailaddress "name@domain.com"
get-mailboxstatistics "username" format-list
get-mailboxstatistics -server "name" format-list
get-mailboxstatistics -server "name" sort-object -property totalitemsize

Meeting Resources
new-mailbox -userprincipalname "name@domain.com" -alias name -database "name" -name name -organizationalunit name -displayname "name" -room/-equipment
set-mailboxcalendarsettings name -automateProcessings autoaccept
set-mailboxcalendarsettings name -resourcedelegate name

Mail Store
get-mailboxdatabase -server name set-mailboxdatabase -issuewarningquota 100mb -prohibitsendquota 100mb
mount-database databasename
dismount-database databasename
new-storagegroup name -server name
new-mailboxdatabase name -storagegroup name

Public Folders
new-publicfolder name -server name
set-publicfolder \name -replicas "server\database","server2\database2"
get-publicfolder \name
set-publicfolderdatabase "server\database" -usecustomreferralserverlist $true/$false -publicfolderreferralserverlist $null
get-publicfolderstatistics
enable-mailpublicfolder -i "\foldername"

Transport
new-accepteddomain -name "name" -domainname name.domain.com -domaintype authoritative
new-emailaddresspolicy -name "name" -includedrecipients allrecipients -conditionaldepartment "departmentname" -enabledemailaddresstemplate: "SMTP:%g.%s@mkt.adatum.com","%g.%s@adatum.com"
set-emailaddresspolicy "name" -Priority #
get-emailaddresspolicy
update-emailaddresspolicy "policyname"
get-queue
freeze-queue
unfreeze-queue

Edge Transport
new-edgesubscription -filename "filelocation"
start-edgesynchronization

Address List
new-addresslist -name "listname" -conditionaldepartment "departmentname" -includedrecipients mailboxusers -container "containername"
update-addresslist "listname"

Testing
test-mailflow
test-owaconnectivity
test-mapiconnectivity
test-servicehealth
test-systemhealth

Autodiscover
new-outlookprovider
get-outlookprovider
set-outlookprovider exch -server "servername"
remove-outlookprovider
new-autodiscovervirtualdirectory
get-autodiscovervirtualdirectory
set-autodiscovervirtualdirectory -externalurl URL -internalurl URL -path "location"

Out of Office
set-mailbox name -externaloofoptions internalonly/external

Outlook Web Access (OWA)
set-owavirtualdirectory -externalurl URL -internalurl URL

Monday, October 12, 2009

New certificate in Exchange 2007


New-ExchangeCertificate -generaterequest:1 -domainname domain.com,mail.domain.com,smtp.domain.com,pop3.domain.com -privatekeyexportable:1 -path c:\cert1.txt -force:1

OR


1. Generate certificate using web access to your Certification authority - logon as administrator


2. Export certificate to a location on the disk… c:\cert.pfx


3. Import-ExchangeCertificate -Path c:\cert.pfx –Password:(Get-Credential).password
the Get-Credential will open popup windows for credentials.

4. Enable-ExchangeCertificate -thumbprint 5ACC9A5D90E2CFDBCD6E25CD02362B851266810 -Services “IIS,POP,SMTP,IMAP”

5.Get-ExchangeCertificate ..to get all certificate list.

To remove old certificates:

Remove-ExchangeCertificate -Thumbprint …………

Friday, October 9, 2009

Exchange Server 2007 CCR Configuration.

Exchange server 2007 introduces new features for high availability.one of them is Cluster Continuous Replication (CCR).This feature uses log shipping and replay with windows active /passive cluster setup.

you need following in order to configure CCR.

A Windows 2003 Active Directory forest with at least one Domain Controller
Two Windows 2003 Server R2 Enterprise Editions or Windows 2003 Server SP2 Enterprise Editions.
One Windows File share Witness (Microsoft recommends this to be an Exchange 2007 Hub Transport Server in the existing Exchange 2007 organization)

When you start the servers that are to be the nodes in the cluster, start by naming the machines E2K7Node1 and E2K7Node2 or whatever naming scheme you want to use (these names have nothing to do with the Exchange server name which your clients will be configured to connect to later on). Now name the two network connections Public and Private for the external and the internal network respectively (remember to do this on both nodes).




Click Advanced > Advanced Settings, make sure Public is listed first on the binding order list, then Private and lastly Remote Access Connections.



Before Exchange 2007 SP1 released, it was also recommended to disable File and Printer Sharing for Microsoft Networks for the private network as shown in Figure 3. However, when SP1 released this guidance changed, since Exchange 2007 SP1 introduced a new cmdlet named Enable-ContinuousReplicationHostName. This cmdlet makes it possible to specify over which network log files should be ship and seeded. So no matter whether you deploy CCR on Windows 2003 or Windows 2008 based servers, please don’t disable File and Printer Sharing for Microsoft Networks for the private network.





Configure the Public network with the respective network settings you use in your test environment.




Configure the Private network with an IP address and a subnet mask. Nothing else is required since this network is only used for communication (heartbeats) between the nodes in the cluster.


Now click Advanced then select the DNS tab. Here you should untick both Register this connection's addresses in DNS and Use this connection's DNS suffix.



Click the WINS tab. Untick Enable LMHOSTS lookup and select Disable NetBIOS over TCP/IP.



Click OK three times and close the network connections window.

Now add both Windows 2003 Servers as member servers in your Active Directory test domain.



Creating and Configuring the Windows 2003 Server Cluster
Now that the two servers are ready to act as nodes in a Windows 2003 cluster, it’s time to create the actual Windows 2003 Server Cluster. In order to do so logon to E2K7Node1 with a Domain admin account, then click Start > Administrative Tools > Cluster Administrator, and select Create new cluster in the drop-down box. Now click OK.



Note
You can also open a command prompt and type Cluster.exe /create /wizard in order to start the cluster wizard.

Click Next.

Followers