Monday, May 19, 2014

Get command Microsoft Exchange server 2010

To view organization-wide e-mail transport 
Get-TransportConfig

To Set organization Limits
Set-TransportConfig -MaxSendSize 20MB -MaxReceiveSize 20MB -MaxRecipientEnvelopeLimit 300

To view the configuration information for a Send connector on a computer that has the Hub Transport server 
Get-SendConnector

Send Connectors 
Get-SendConnector | FL

Set Send Connector Message Size Limit for a specific connector
Set-SendConnector -Identity “Default Internet Connector” -MaxMessageSize 20MB

Set Send Connector Message Size Limit for all connectors
Get-SendConnector | Set-SendConnector -MaxMessageSize 20MB

To view the configuration information for Receive Connectors
Get-ReceiveConnector

Set MaxMessageSize for All Receive Connectors
Get-ReceiveConnector | Set-ReceiveConnector -MaxMessageSize 20MB

Get MaxSendSize and MaxReceiveSize Mailbox Limits for a user
Get-Mailbox BAndersen | FL MaxSendSize,MaxReceiveSize

Set MaxSendSize and MaxReceiveSize Mailbox Limits for a user
Set-Mailbox -Identity BAndersen -MaxSendSize 40MB -MaxReceiveSize 40MB

Event id 12014, Microsoft Exchange server 2010 Certificate

12014
---------
1. new-exchangecertificate -domainname <> -services smtp

or

1. new-exchangecertificate -domainname " " -services "smtp, pOP, IMAP"

2. Get-exchangecertificate -thumbprint <> | New-ExchangeCertificate

3. enable-exchangecertificate <thumbprint> -services smtp   // optional

4. remove-exchangecertificate FDBA5E496E09713E89AFC6E7BF4C6AF78D943BC7

HKLM\Software\microsoft\systemcertificates\my\certificates

5. Get-Exchangeserver  //To check which servers are using certificate

3rd Party
1. New-ExchangeCertificate
          -GenerateRequest -PrivateKeyExportable:$true
          -SubjectName "c=us, o=securityplanning.com, cn=DC-Mail.securityplanning.com"
          -DomainName DC-Mail.securityplanning.com
           -Path c:\certpop.txt
2. Import-ExchangeCertificate -Path "c:\certnew.cer"
3. Enable-ExchangeCertificate –Thumbprint <thumbprints> -Services "IIS, POP, IMAP"

How to import 3rd party in the Exchange server 2k7
Import-ExchangeCertificate -Path c:\CertificatefileName.crt | Enable-ExchangeCertificate -Services pop, imap, smtp, iis

Tuesday, May 13, 2014

Content Index is in Crawling state Update-MailboxDatabaseCopy

On Exchange 2010, Sp3

[PS] C:\Windows\system32>Get-Mailboxdatabasecopystatus -server MAILBOX1.DOM.Local | fl Name, *Index*


Name                     : EXDB2\MAILBOX1
ContentIndexState        : Crawling
ContentIndexErrorMessage :


from looking at the message from the command by running Get-mailboxdatabaseCopyStatus 

Crawling state is where Exchange Search indexes mailboxes in the database. The status remains Crawling until all mailboxes in the database have been indexed. After all mailboxes in the databases have been indexed, Exchange Search changes the status of the database to Notification.

so wait untill Crawling notifications changes to Healthy state
but what happen if the Crawling is been running for days and no status change. Check the event log and find any thing related with search.

Last resort, Stop the "Microsoft Search (Exchange)" Service and delete the Catalogue file from the location C:\Program Files\Microsoft\Exchange Server\V14\Mailbox\AMBX1-2\CatalogData-8e5f65e1-26f6-4c7e-80d4-389b6c62ce18-9ef437c4-3229-4afd-a55d-cfd1637cfde4

please note : AMBX1-2\CatalogData-8e5f65e1-26f6-4c7e-80d4-389b6c62ce18-9ef437c4-3229-4afd-a55d-cfd1637cfde4 

AMBX1-2 is the name of the Database and CatalogData-8e5f65e1-26f6-4c7e-80d4-389b6c62ce18-9ef437c4-3229-4afd-a55d-cfd1637cfde4  is the name of the Catalog data name which may be differ in your environment.

from the user's Prespective, they will find difficulty getting search result in OWA. In Outlook, if they are in Cached mode, then old query will find the result for newer query it will take time until Content Index State is in Healthy state.


Now, "Content Index State" is in Healthy state, to update to passive node, you can run these two commands

Option 1
Reseed the catalog from a specific server (EMS)
C:\>Update-MailboxDatabaseCopy -Identity DB1\MBX1 -SourceServer MBX2 -CatalogOnly

Option 2
Reseed the catalog from any server (for Active node) (EMS)
C:\>Update-MailboxDatabaseCopy -Identity “databasename\servername” -CatalogOnly


If you want to activate Mailbox Database to another server and unable to mount due to Catalog Index error or INDEXing is disable then 
User the below Powershell command

C:\>Move-ActiveMailboxDatabase <DatabaseName> -ActivateOnServer <TargetServerName> -SkipClientExperienceChecks


Monday, May 12, 2014

How to set sent item for both Manager and Delegated user "Exchange server 2010"


Output of MailboxSentItemsConfiguration Manager

[PS] C:\Windows\system32>Get-MailboxSentItemsConfiguration Manager
RunspaceId                  : 38eb470d-f92d-4381-afa0-5bb7b8741e02
SendAsItemsCopiedTo         : Sender
SendOnBehalfOfItemsCopiedTo : Sender
Identity                    :
IsValid                     : True




[PS] C:\Windows\system32>Set-MailboxSentItemsConfiguration Manager -SendAsItemsCopiedTo SenderAndFrom

[PS] C:\Windows\system32>Get-MailboxSentItemsConfiguration Manager

RunspaceId                  : 38eb470d-f92d-4381-afa0-5bb7b8741e02

SendAsItemsCopiedTo         : SenderAndFrom    ----> This will set the option when user sents an Email on the behalf of, it would be showed into both (Manager and Sender's) Sent item

SendOnBehalfOfItemsCopiedTo : Sender

Identity                    :

IsValid                     : True

This option would be available after Exchange 2010 Sp RU2

Tuesday, April 22, 2014

Logs location for DAG Troubleshooting Exchange 2010

For troubleshooting DAG issue, Please collect the following logs from the location

(   Need to run on either of the server
(  a)   Please run EXBPA from the “Exchange Management Console” > Tools > EXBPA    
 Send me the reports in the default XML format using Option “Export report”.

How to run EXBPA, pls refer site for reference.


    Need to collect logs from both Nodes
  (a)   Event Viewer > Application and Service Logs > Microsoft-Exchange-Troubleshooters/Operational


  (b)   Event Viewer > Application and Service Logs > MSExchange Management


  (c)   Event Viewer > Application and Service Logs > Microsoft > Exchange > HighAvailability

  (d)   Event Viewer > Application and Service Logs > Microsoft > Exchange > MailboxDatabaseFailureItems


  (e)    Event Viewer > Application and Service Logs > Microsoft > Exchange > Troubleshooters

  (f)   Event Viewer > Application and Service Logs > Microsoft > Exchange > Troubleshooters

    If possible, Please collect and save logs in CSV format and upload to FTP location under “Exchange Logs” Folder.




Exchange 2010, from Exchange Management Shell

Get-MailboxDatabase | fl Name,EdbFilePath,LogFolderPath

and from Windows Explorer
C:\Program Files\Microsoft\Exchange Server\V14\Mailbox\"nameofDatabase"


From the Exchange Command Shell
(Get-WinEvent -LogName Microsoft-Exchange-ManagedAvailability/* | % {[XML]$_.toXml()}).event.userData.eventXml| ?{$_.ActionID -like "*ForceReboot*"} | ft RequesterName

Above command will search for the "Microsoft-Exchange-ManagedAvailability" for a value like "force Reboot"


Increase diagnostic logging for Transport Server
Message tracking log
SMTP send/receive logs



Few Message tracking logs from msexchangeguru.com


Some of the Message Tracking cmdlets I use often:
To find Send Emails:
Get-MessageTrackingLog -resultsize unlimited -Start “06/01/2014 4:30:00 PM” -End “06/04/2014 5:17:00 PM” |where-object {$_.Recipients -like “*@contoso.com” -AND $_.EventId -eq “Send”} | where {$_.recipients -like “*@ contoso.com”} | Select @{Name=’Recipients';Expression={[string]::join(“;”, ($_.Recipients))}}, Sender, EventId, Timestamp, Source, MessageSubject | Export-CSV “C:EmailAddress_Statistics_Send.csv”
Get-MessageTrackingLog -resultsize unlimited -Start “12/02/2014 4:20:00 PM” -End “12/02/2014 07:30:00 PM” |where-object {$_.EventId -eq “Send”} | Select @{Name=’Recipients';Expression={[string]::join(“;”, ($_.Recipients))}}, Sender, EventId, Timestamp, Source, MessageSubject | Export-CSV “C: Dec2_Email_Statistics_Send.csv”
Get-Messagetrackinglog -Resultsize Unlimited | Where {$_.Sender -match “@contoso.com”} -EventID “Send” -Start “12/02/2014 4:20:00 PM” -End “12/02/2014 07:30:00 PM” | Select @{Name=’Recipients';Expression={[string]::join(“;”, ($_.Recipients))}}, Sender, EventId, Timestamp, Source, MessageSubject | Export-CSV “C: Dec2_Email_Statistics.csv”
To find Received Emails:
Get-MessageTrackingLog -resultsize unlimited -Start “12/02/2014 4:20:00 PM” -End “12/02/2014 07:30:00 PM” |where-object {$_.Recipients -like “*@ contoso.com” -AND $_.EventId -eq “RECEIVE”} | where {$_.recipients -like “*@contoso.com”} | Select @{Name=’Recipients';Expression={[string]::join(“;”, ($_.Recipients))}}, Sender, EventId, Timestamp, Source, MessageSubject | Export-CSV “C:EmailAddress_Statistics_Receive.csv”
Get-MessageTrackingLog -resultsize unlimited -Start “12/02/2014 4:20:00 PM” -End “12/02/2014 07:30:00 PM” |where-object {$_.EventId -eq “RECEIVE”} | Select @{Name=’Recipients';Expression={[string]::join(“;”, ($_.Recipients))}}, Sender, EventId, Timestamp, Source, MessageSubject | Export-CSV “C: Dec2_Email_Statistics_Receive.csv”
Get-MessageTrackingLog -resultsize unlimited |where {$_.MessageSubject -like “Win a Lottery”} >> “C:UsersusernameDesktopoutput.txt”
Get-MessageTrackingLog -resultsize unlimited -Start “6/3/2013 12:29:00 PM” -End “6/6/2013 12:39:00 PM” |where {$_.MessageSubject -like “Update your Social Security Number”} >> “C:UsersusernameDesktopoutput.txt”
Get-MessageTrackingLog -Server HUBServerName -resultsize unlimited |where-object {$_.Recipients -like “*@contoso.com” -AND $_.EventId -eq “Send”} | where {$_.recipients -like “*@contoso.com”} | ft EventId,Timestamp,Sender,recipients,MessageSubject,@{label=”size”;Expression={$_.Totalbytes/1mb}} >>c: @contoso_emails.csv
Get-Messagetrackinglog -Server HubServerName -resultsize unlimited -Sender “User@contoso.com” -EventID “SEND” -Start “5/10/2012 12:29:00 PM” -End “6/4/2012 12:39:00 PM” |ft Timestamp, Source, EventID, Recipients, MessageSubject, RecipientStatus, @{label=”size”;Expression={$_.Totalbytes/1mb}}
Get-Messagetrackinglog -Server HubServerName -resultsize unlimited -Start “12/01/2012 12:29:00 PM” -End “12/06/2012 12:39:00 PM” |where {$_.MessageSubject -like “Click Here to be SOX Compliant”} |ft Timestamp, Source, EventID, Recipients, MessageSubject, RecipientStatus, @{label=”size”;Expression={$_.Totalbytes/1mb}}
Domain based search: To find all emails from a specific domain in Exchange server
Get-MessageTrackingLog -Server hub1 -resultsize unlimited -Start “2/24/2013 12:29:00 AM” -End “2/26/2013 12:29:00 PM” |where-object {$_.Sender -match “contoso.com” -AND $_.EventId -eq “Receive”} | ft EventId,Timestamp,Sender,recipients,MessageSubject,@{label=”size”;Expression={$_.Totalbytes/1mb}}
Get-MessageTrackingLog -resultsize unlimited -Start “9/10/2014 12:29:00 PM” -End “9/12/2014 12:39:00 PM” |where {$_.MessageSubject -like “Pay off your Mortgage”} |fl Recipients, MessageSubject, Sender, ReturnPath, EventID
Get-Messagetrackinglog -Recipients:user@contoso.com -EventID “RECEIVE” -Start “05/25/2014 4:30:00 PM” -End “05/30/2014 5:17:00 PM”
Get-Messagetrackinglog -Recipients:user@contoso.com -EventID “RECEIVE” -Start “05/25/2014 4:30:00 PM” -End “05/30/2014 5:17:00 PM” | Select @{Name=’Recipients';Expression={[string]::join(“;”, ($_.Recipients))}}, Sender, EventId, Timestamp, Source, MessageSubject | Export-CSV “C:EmailAddress_Statistics_forUser.csv”

Wednesday, April 16, 2014

how to find the install date of Windows OS

something quick, how to find the install date of Windows OS

Use this command from command prompt

systeminfo | find /i “install date”

SETSPN.EXE

Check the SPN for the server

SETSPN.EXE –i <FQDN of server>
it should be resulted in the below manner
SmtpSvc/fqdn
SmtpSvc/fqdn.domain.

To remove the SPN for the server or URL
Setspn -d <fqdn >