Pages

Wednesday, January 30, 2019

Setup Ms Exchange

Setup Ms Exchange

1. Extend the Active Directory schema
.\Setup.exe /PrepareSchema /IAcceptExchangeServerLicenseTerms

2. Prepare Active Directory
"Setup.exe /PrepareAD /OrganizationName:"" /IAcceptExchangeServerLicenseTerms"

OrganizationName: get-OrganizationConfig | fl Identity

.\Setup.exe /PrepareAD /OrganizationName:"ABC Organization" /IAcceptExchangeServerLicenseTerms


3. Prepare Active Directory domains
.\Setup.exe /PrepareAllDomains /IAcceptExchangeServerLicenseTerms

Exchange DAG Node Failure – Force Switchover With Queues
I had this issue with a client last week, the system was Exchange 2010 with a 2 node Database Availability Group (DAG) setup. One of the Exchange nodes had gone offline and this would be permanent as the failure was catastrophic. I checked that the second node had kicked into action but it had not. The mailbox database was down and upon checking the replication status of the mailbox database to the second node the copy queue was at 9223372036854775766.
Because of this when I tried to force fail over I was greeted with the following error.
An Active Manager operation failed. Error The database action failed. Error: An error occurred while trying to validate the specified database copy for possible activation. Error: Database copy ‘Database1’ on server ‘dagnode2.domain.com’ has a copy queue length of 9223372036854725486 logs, which is too high to enable automatic recovery. You can use the Move-ActiveMailboxDatabase cmdlet with the -SkipLagChecks and -MountDialOverride parameters to move the database with loss. If the database isn’t mounted after successfully running Move-ActiveMailboxDatabase, use the Mount-Database cmdlet to mount the database.
I was pretty confident that no mail would be lost as all my clients are in cached mode so upon reconnecting to the CAS server they would sync mail backup to to second mailbox server.
Upon running the command mentioned in the error I was again greeted with red warning errors stating the that it could not start the Microsoft Exchange Search Indexing service on the failed node…that’s because it does not exist anymore, great.
To get around this we need to add a few extra flags to the command above. They are as below.
·         SkipActiveCopyChecks – The SkipActiveCopyChecks parameter specifies whether to skip checking the current active copy to see if it’s currently a seeding source for any passive databases. Be aware that when using this parameter, you can move a database that’s currently a seeding source, which cancels the seed operation.
·         SkipClientExperienceChecks – The SkipClientExperienceChecks parameter specifies whether to skip the search catalog (content index) state check to see if the search catalog is healthy and up to date. If the search catalog for the database copy you’re activating is in an unhealthy or unusable state and you use this parameter to skip the search catalog health check and activate the database copy, you will need to either re-crawl or reseed the search catalog.
With this in mind we run the following commands to force our node back into life even though the mailbox database is not fully synced.
Move-ActiveMailboxDatabase database1 -ActivateOnServer dagnode2 -SkipHealthChecks -SkipActiveCopyChecks -SkipClientExperienceChecks -SkipLagChecks -MountDialOverride:BESTEFFORT

Ex: Move-ActiveMailboxDatabase "Mailbox Database 1984723136" -ActivateOnServer SRVEX2 -SkipHealthChecks -SkipActiveCopyChecks -SkipClientExperienceChecks -SkipLagChecks -MountDialOverride:BESTEFFORT
Once ran your database will now mount and clients will be able to connect. As mentioned this works well for situations where you have a 2 node DAG cluster with one node down and the copy queue length does not allow automatic failure.


Monday, January 28, 2019

How Do I Find the Partition GUID

You can use WMI to get the information, See the following powershell example:
GWMI -namespace root\cimv2 -class win32_volume | FL -property DriveLetter, DeviceID


Friday, January 11, 2019

Move the Exchange 2010/13/16 System Mailbox

Move the Exchange 2010/13/16 System Mailbox to new Database Store 
1. First we need to get the details of the system mailbox and the databases, run the below commands to get the information:

Get-Mailbox -Arbitration | FL Name,DisplayName,ServerName,Database,AdminDisplayVersion
Get-MailboxDatabase -IncludePreExchange2013 | FL Name,Server,AdminDisplayVersion

2. Once we get all the details, we need to move the System mailbox using the below command:

Get-Mailbox -Arbitration -Identity "SystemMailbox{e0dc1c29-89c3-4034-b678-e6c29d823ed9}" | New-MoveRequest -TargetDatabase NEWDatabase

3. Check
Get-Mailbox -Arbitration | FL Name,DisplayName,ServerName,Database,AdminDisplayVersion

Monday, December 3, 2018

Delete old logs on Exchange servers

The following commands delestes logs older than 14 days on Exchange servers:
forfiles /p C:\inetpub\logs /s /m *.log /d -14 /c “cmd /c del @path”
forfiles /p C:\Program Files\Microsoft\Exchange Server\V15\Bin\Search\Ceres\Diagnostics\ETLTraces /s /m *.log /d -14 /c “cmd /c del @path”
forfiles /p C:\Program Files\Microsoft\Exchange Server\V15\Bin\Search\Ceres\Diagnostics\Logs /s /m *.log /d -14 /c “cmd /c del @path”
forfiles /p C:\Program Files\Microsoft\Exchange Server\V15\Logging /s /m *.log /d -14 /c “cmd /c del @path”
forfiles /p C:\Program Files\Microsoft\Exchange Server\V15\Logging\Diagnostics\PerformanceLogsToBeProcessed /s /m *.log /d -14 /c “cmd /c del @path”
forfiles /p C:\Program Files\Microsoft\Exchange Server\V15\Logging\Monitoring\Monitoring\MSExchangeHMWorker\ActiveMonitoringTraceLogs /s /m *.log /d -14 /c “cmd /c del @path”
forfiles /p C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\data\Temp /s /m *.log /d -14 /c “cmd /c del @path”

How To Reset The Outlook Address Cache

How To Reset The Outlook Address Cache

If you are typing email addresses into your Outlook and they have gone wonky there are several things you can do but the easiest is likely just to flush the Outlook Address autocomplete cache.  In old versions of Outlook, that meant deleting the .NK2 file from %appdata%\Microsoft\Outlook however in Outlook 2016 (actually since Outlook 2010) your ‘nickname’ cache is stored in %localappdata%\Microsoft\Outlook\RoamCache

There are three easy ways to empty the Outlook Autocomplete Email Address Cache:

1. Flush The Outlook Email Address Cache Using File Manager:
Close Outlook
Using File Explorer, MY PC, THIS PC or whateva’, go to %localappdata%\Microsoft\Outlook\RoamCache
Delete Stream_Autocomplete_0_.dat 
Open Outlook
Have a nice day

2. Flush The Outlook Email Address Cache Using the Outlook GUI:clear-autocomplete-outlook-address-cache
Open Outlook
Click FILE
Click OPTIONS
Click MAIL
Scroll down about half way and select EMPTY AUTOCOMPLETE button
Have a nice day

3. Flush The Outlook Email Address Cache Using Command Line:
outlook.exe /cleanautocompletecache
Have a nice day
If you have any questions, post them here or read:

https://www.slipstick.com/outlook/email/understanding-outlooks-autocomplete-cache-nk2/
https://grok.lsu.edu/article.aspx?articleid=18029

Wednesday, November 14, 2018

Xóa log Mail Exchange và IIS


Dùng Exchange Management Shell chạy lệnh bên dưới để xóa log Exchange 2010/13/16 và IIS

gci `XXX:\LogExchange','XXX:\inetpub\logs' -Directory | gci -Include `*.log','*.blg' -Recurse | ? LastWriteTime -lt (Get-Date).AddDays(-7) | Remove-Item


-7: Điều chỉnh số ngày xóa log

XXX: Đường dẫn chưa file log

Friday, October 5, 2018

Tìm và xóa tất cả các email trong inbox user

Tìm và xóa tất cả các email trong inbox user

Get-Mailbox -ResultSize unlimited | Search-Mailbox -SearchQuery 'Subject:"Your query"' - DeleteContent

Get-Mailbox -ResultSize unlimited | Search-Mailbox -SearchQuery 'Subject:"Reply to reemalhashimy@fffff.com"' -DeleteContent

Tuesday, September 25, 2018

Cấu hình Linksys PAP2T




ATA Linksys PAP2T có 4 cổng và tương ứng với nó là 4 đèn báo hiệu trạng thái. Gồm có:
  • Cổng nguồn: Cắm dây nguồn để cung cấp điện ATA
  • Cổng Ethernet: Nối với dây cáp mạng dùng cho voice
  • Phone 1 và phone 2: Là nơi nối với 2 điện thoại analog sử dụng cho 2 điện thoại truyền thống ( phone 1 và phone 2 có thể hoạt động riêng biệt với nhau )

Wednesday, September 19, 2018

Send an image from pen input via email

Office365.SendEmail("youremail@gmail.com","Subject" , "Body Text",{Attachments:Table({Name:"peninput.jpg",ContentBytes: PenInput1.Image , '@odata.type':""},{Name:"peninput2.jpg",ContentBytes: PenInput2.Image , '@odata.type':""})})