Friday, 5 June 2020

How to move multiple databases with a single command to another mailbox server in Exchange Server 2016

Some time you may have to activate a group of DBs on a server, then you have 2 option to perform this task, 1 is from ECP but it will take some long time if you have some multiple DBs. Second option is to use Exchange management shell, which will save your time and also will perform this task very easily.
So you can perform the following command in exchange management shell.
for example you have 4 DBs, all end with 01 numbers, which you want to be activated on MBS01 server.



Get-MailboxDatabase *601 | Move-ActiveMailboxDatabase -ActivateOnServer MBS01

To verify you can use the following command
Get-MailboxDatabase *601

[PS] C:\Windows\system32>Get-MailboxDatabase *1601
Name                           Server          Recovery        ReplicationType
----                           ------          --------        ---------------
HR1601                     MBS01  False           Remote
IT1601                     MBS01  False           Remote
M1601                     MBS01  False           Remote
P1601                     MBS01  False           Remote

So we can see here that all the required DBS are activated on MBS01 with a single command.

Thursday, 4 June 2020

How to register Exchange server 2016 keys with powershell

Some time you may be unable to enter the Exchange server 2016 product key from ECP/EAC.
As i faced the same. i migrated an exchange environment from exchange server 2013 to exchange 2016. the ECP was still pointing to the exchange server 2013 CAS server. so when i tried to enter the product from ECP i was getting an error like as below

"An error occurred while accessing the registry on the server "Servername". The error that occurred is: "The network path was not found. "."

And the reason might be that the virtual directory i.e (https://mail.domain.com/ECP) was still pointing to the 2013 CAS servers.

So then i tried to put/enter the key through power shell as below and i was able to register the server in this way.
  
Set-ExchangeServer -Identity ServerName -ProductKey 8JHUYI-JHUYM-VNMFE-FGHJY-HJYUTV

So per my experience, if you want to register the key for the 2016 through ECP (https://mail.domain.com/ECP), your required virtual directory should be pointing to that 2016 environment/server. 

Monday, 25 May 2020

Database Status Passive Failed and Suspended, Content index state: Suspended in exchange server 2016

I have Exchange Server 2016 DAG, consist of 2 PR and 1 DR servers. the PR DBs status was Healthy but the DR DBs were in Status Passive Failed and Suspended, Content index state: Suspended
Tried different solutions to reseed but know luck.
Solution:
there are two solutions, which you may try.
1:
From ECP, instead of Resuming the copy, tried to Update the effected copy, which recreated the copy and the issue was resolved.

2:
From Exchange power shell you may use
Update-MailboxDatabaseCopy -Identity "DBname\ServerName" -SafeDeleteExistingFiles

More Detail:

I looked into the path on the effected server/database and the database file (venDB2.edb) was not found.
I also tried to update the effected copy with -catalogonly switch as mentioned below but no luck as were getting the given warning.
.
[PS] C:\Windows\system32>Get-MailboxDatabaseCopyStatus VenDB2\XMBS2 | Update-MailboxDatabaseCopy -CatalogOnly
Confirm
Are you sure you want to perform this action?
Seeding database copy "VenDB2\XMBS2".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [?] Help (default is "Y"): y
WARNING: Seeding of content index catalog for database 'VenDB2' failed. Please verify that the Microsoft Search
(Exchange) and the Host Controller service for Exchange services are running and try the operation again. Error: There
was no endpoint listening at
net.tcp://localhost:3863/Management/SeedingAgent-78CFB425-GE76-4B17-9B48-2E3BE436368812/Single that could accept the
message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more
details..

So after running
Update-MailboxDatabaseCopy -Identity "DBname\ServerName" -SafeDeleteExistingFiles
it delete the already created logs file and create the logs files again and create the DB file as well.


P.S:
It may take some long time, depending on the size of database size, as both the database copy and the content index catalog copy will be recreated/copied to the server.
So you should wait until all of the files are copied, you can monitor in the ECP console.
or you can use the following command.
Get-MailboxDatabaseCopyStatus VenDB2\XMBS2


Note: Posts are provided “AS IS” without warranty of any kind, always based on my experience and findings in my routine tasks in my production environment.



Saturday, 23 May 2020

How to export all member of a group in AD with their specific attributes

How to export all member of a group in AD and their specific attributes

PS C:\Windows\system32>$group = "ABCGroup"

PS C:\Windows\system32> Get-ADGroup $group -Properties Member | Select-Object -Expand Member | Get-ADUser -Property * | ft company, whenCreated, lastLogonTimestamp, mobile > C:\ABCGroup.CSV

Monday, 11 May 2020

How to update meta data in a Relying Party Trust in ADFS

First you should note the name of the Relying Party Trust with the following command.

PS C:\Windows\system32>get-ADFSRelyingPartyTrust | ft name

once you get the name of the Relying Party Trust which you want to update, use the following command


PS C:\Windows\system32> update-ADFSRelyingPartyTrust -targetName "Planning & Budgeting " -MetadataFile "C:\Users\adc\Desktop\DataCloud.xml"

Saturday, 28 March 2020

The specific error code was 0xC00402C7

"The specific error code was 0xC00402C7."

After installing/configuring SMTP server in windows server 2016 IIS. I was unable to send emails through this new SMTP to any domains. Mails were getting stuck in "C:\inetpub\mailroot\Badmail" folder.
after opening one of notepad file in this path. the error "The specific error code was 0xC00402C7." was mentioned there in the failed logs (notepad files).
Secondly, in the system logs of the SMTP server, getting the event ID=4007, with below detail as warning.

"Message delivery to the host '14.47.3.33' failed while delivering to the remote domain 'live.com' for the following reason: An SMTP protocol error occurred.
 The SMTP verb which caused the error is 'MAIL'.  The response from the remote server is '550 5.7.1 Service unavailable, Client host [18.176.15.17] blocked using Spamhaus. To request remo'
."

So have to first check in black provider list and yes found there that my IP was appearing there as in PBL.
so putted the request there to whitelist my server IP and wait for some time.

Now after waiting for some more than a hour, tested again and were able to send emails to any domain.


Thursday, 20 February 2020

Unable to install CMS database for skype for business 2015 in SQL server 2016

Have recently migrated from Lync server 2010 to Skype for business 2015. All users migrated to skype for business 2015 and as a last step trying to move the CMS database from Lync server 2010 to skype for business 2015.
As mentioned in( https://docs.microsoft.com/en-us/lyncserver/move-the-lync-server-2010-central-management-server-to-lync-server-2013 ) for CMS migration, first to install the CMS database on the skype for business 2015 FE server but while trying the (Install-CsDatabase -CentralManagementDatabase -SQLServerFQDN C01ict-SFBdb.abc.domain.com -SQLInstanceName RTC) command, getting the below error.
Now if we look into the error, it is mention that (Install-CsDatabase : Failed to connect to the SQL server C01ict-SFBdb.abc.domain.com\RTC) means unable to connect to the RTC instance. and yes the RTC instance was not in the SQL server, so we have to create the RTC instance in SQL server or have to use the install-csdatabase command without the -SQLInstanceName switch, which is an easy way. so the required database will be created in the default install of SQL server. so we change the command to (Install-CsDatabase -CentralManagementDatabase -SQLServerFQDN C01ict-SFBdb.abc.domain.com) and the below error was gone. the LIS and XDS databases were created within SQL default instance. and the issue was resolved.


Error:
Loading Modules for Skype for Business Server 2015...
PS C:\Users\User> Install-CsDatabase -CentralManagementDatabase -SQLServerFQDN C01ict-SFBdb.abc.domain.com -SQLInstance
Name RTC
****Creating DbSetupInstance for 'Microsoft.Rtc.Common.Data.XdsDatabase'****
Trying to connect to Sql Server C01ict-SFBdb.abc.domain.com\RTC. using windows authentication...
Exception Stack:
Type: System.Reflection.TargetInvocationException, Message: Exception has been thrown by the target of an invocation.
Type: Microsoft.Rtc.Common.Data.DbSetupSqlServiceNotInstalledException, Message: Failed to find SQL Service. Make sure t
hat SQL Server service (instance name RTC) is installed in machine C01ict-SFBdb.abc.domain.com
Install-CsDatabase : Failed to connect to the SQL server C01ict-SFBdb.abc.domain.com\RTC.
At line:1 char:1
+ Install-CsDatabase -CentralManagementDatabase -SQLServerFQDN C01ict-S ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:SourceCollection) [Install-CsDatabase], DbSetupSqlServiceNotInstalled
   Exception
    + FullyQualifiedErrorId : SqlConnectionFailure,Microsoft.Rtc.Management.Deployment.InstallDatabaseCmdlet
****Creating DbSetupInstance for 'Microsoft.Rtc.Common.Data.LisDatabase'****
Trying to connect to Sql Server C01ict-SFBdb.abc.domain.com\RTC. using windows authentication...
Exception Stack:
Type: System.Reflection.TargetInvocationException, Message: Exception has been thrown by the target of an invocation.
Type: Microsoft.Rtc.Common.Data.DbSetupSqlServiceNotInstalledException, Message: Failed to find SQL Service. Make sure that SQL Server service (instance name RTC) is installed in machine C01ict-SFBdb.abc.domain.com
Install-CsDatabase : Failed to connect to the SQL server C01ict-SFBdb.abc.domain.com\RTC.
At line:1 char:1
+ Install-CsDatabase -CentralManagementDatabase -SQLServerFQDN C01ict-S ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:SourceCollection) [Install-CsDatabase], DbSetupSqlServiceNotInstalled
   Exception
    + FullyQualifiedErrorId : SqlConnectionFailure,Microsoft.Rtc.Management.Deployment.InstallDatabaseCmdlet
WARNING: Install-CsDatabase failed.
WARNING: Detailed results can be found at
"C:\Users\User\AppData\Local\Temp\Install-CsDatabase-975ca94c-1c88-41bd-80e4-54e4265b8dc8.html".
PS C:\Users\User>