none
Health Logs of Exchange Servers RRS feed

All replies

  • Hi Sudheer,

    The script you provided is used to check Lync server health instead of the Exchange server.

    There is a script for you to generate health report for your Exchange server. You can download from here: Generate Health Report for an Exchange Server 2016/2013/2010 Environment

    You can check this blog for more information about this script: Test-ExchangeServerHealth.ps1 – PowerShell Script to Generate a Health Check Report for Exchange Server 2016/2013/2010

    Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.

    Regards,

    Lydia Zhou


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.

    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    Tuesday, July 16, 2019 2:11 AM
  • Sorry,

    Its my mistake for not explaining properly.

    But we are already using the script from the link below

    Finally customer is expecting to get CMS Replication data from the servers that have been entered in servers.txt

    But unfortunately it is picking all the servers,please let me know your inputs 

    https://blogs.technet.microsoft.com/stevemoore/2016/09/29/lync-server-2013skype-for-business-health-check-script/

    Regards,

    Sudheer


    Thanks & Regards, Sudheer

    Tuesday, July 16, 2019 4:31 AM
  • Hi,

    Did you use the Server parameter after the script location in the command? 

    As is mentioned in the blog, Server parameter will help you check the specified Exchange server.

    .\Test-ExchangeServerHealth.ps1 -Server <server name>

    Regards,

    Lydia Zhou


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.

    Thursday, July 18, 2019 8:23 AM
  • Hi,

    I have 4-5 servers that needs to be picked up from servers.txt

    Please let me know if I am missing anything in the script.

    Regards,

    Sudheer


    Thanks & Regards, Sudheer

    Friday, July 19, 2019 6:51 AM
  • Hi,

    Exchange server forum mainly discusses and provide suggestions about Exchange server issues. Since your issue is more related to Lync server side, we will help you move this case to Lync forum. You will get more professional suggestions there. Thanks for your understanding. 

    Regards,

    Lydia Zhou


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.

    Tuesday, July 23, 2019 2:01 AM
  • Hi Sudheer Madduru,

    I did a testing with this script, the CMS Replication Data will list all the servers in your Lync environment, no matter the servers listed in the “server.txt”. I think it could not change.


    Best Regards,
    Shaw Lu


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.

    Tuesday, July 23, 2019 10:00 AM
    Moderator
  • Hi,

    Thanks for the reply.

    I made changes for the script and able to compare with servers.txt but server names are getting repeated in the html file

    Please share your inputs to avoid duplicate server names 

    ##-----------------------------------------------------------------------

    ## Function: Get-CMSHTML
    ## Purpose: This function is used to 
    ##-----------------------------------------------------------------------
    function Get-CMSHTML
    {
    [string] $strCMSHTML = "";
    $strCMSHTML = Get-CMSReplicaHead
    $strCMSHTMLRow = Get-CMSReplicaRow

    $strDate = get-date -uFormat "%d-%m-%Y"
    $strCMSHTML = $strCMSHTML -Replace "\<TODAYSDATE\>",$strDate

    $objCMSData = Get-CsManagementStoreReplicationStatus

    $objCMSData | % {        
        
            $filecontent = Get-Content 'C:\lync\scripts\systemstatus\Servers - Copy.txt'
            $list = New-Object System.Collections.ArrayList
                    for( $i=0; $i -lt $filecontent.Length; $i++ )
                    {
                        
                        if($_.ReplicaFQDN -match $filecontent[$i])
                        {
                          
                            $list.Add($filecontent[$i])                       

                        }
                    }
                    
                    foreach($UniqueFQDN in $list | Sort-Object -Unique)
                    {

                        Write-Host "Unique FQDN-"$UniqueFQDN
                        $strHTMLRowNew = $strCMSHTMLRow -Replace "\<REPLICAFQDN\>",$UniqueFQDN  

                    }             
            
    }
    $strCMSHTML = $strCMSHTML + $strHTMLRowNew
    }

    $strCMSHTML = $strCMSHTML + "</table>"

    return $strCMSHTML
    }


    Thanks & Regards, Sudheer


    Wednesday, July 24, 2019 10:10 AM
  • Hi Sudheer,

    What I think is to filter the CMS status result by  “Get-CsManagementStoreReplicationStatus | where {$_.ReplicaFQDN -match <server>}”

    I tried the following scripts, it would only select the CMS status about the servers in the “S.txt” file.

    $filecontent = Get-Content 'C:\test\S.txt'
    $objCMSData = ""
    for( $i=0; $i -lt $filecontent.Length; $i++ )
                    {
                      $CMSData = Get-CsManagementStoreReplicationStatus | where {$_.ReplicaFQDN -match $filecontent[$i]} | Out-String 
    		     $objCMSData = $objCMSData + $CMSData
                    }
    $objCMSData   
    

    The content of “S.txt” is like this:

    Serve1

    Serve2

    Hope it would provide you some ideas.


    Best Regards,
    Shaw Lu


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.

    Thursday, July 25, 2019 8:47 AM
    Moderator
  • Hi Shaw Lu,

    Thanks and it is great that it worked for you.

    May I know in which line the above loop has been inserted?

    Please kindly post your script as I am struggling couple of days.

    Regards,

    Sudheer


    Thanks & Regards, Sudheer


    Thursday, July 25, 2019 12:51 PM
  • Hi Sudheer,

    I could run the above scripts out of the “SystemStatus.ps1”.

    If I insert it into the “SystemStatus.ps1”, it returns a blank value. I think it may be related to that I changed the type of $ObjCMSData which is “Arrylist” by default.

    I would try to do more research.


    Best Regards,
    Shaw Lu


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.

    Friday, July 26, 2019 9:57 AM
    Moderator
  • Hi,

    I tried this script for Get-CMSHTML and it could work in my lab:

    ## Function: Get-CMSHTML
    ## Purpose: This function is used to 
    ##-----------------------------------------------------------------------
    function Get-CMSHTML
    {
    	[string] $strCMSHTML = "";
    
    	$strCMSHTML = Get-CMSReplicaHead
    	$strCMSHTMLRow = Get-CMSReplicaRow
    
    	$strDate = get-date -uFormat "%d-%m-%Y"
    	$strCMSHTML = $strCMSHTML -Replace "\<TODAYSDATE\>",$strDate
    
    
    [System.Collections.ArrayList]$objCMSData = Get-CsManagementStoreReplicationStatus
    
    $filecontent = Get-Content 'C:\test\S.txt'
    
            for( $i=0; $i -lt $objCMSData.count; $i++ )
            {
        
                if ($objCMSData[$i].replicafqdn -notin $filecontent) 
                {
                    $objCMSData.Remove($objCMSData[$i])
                    $i--
                }
                
            }
        
        
    
    	 $objCMSData | % {
    
            $strColour = "#ffffff"
    		$strHTMLRowNew = $null
    		$strHTMLRowNew = $strCMSHTMLRow -Replace "\<REPLICAFQDN\>",$_.ReplicaFQDN
    		$strHTMLRowNew = $strHTMLRowNew -Replace "\<COLOUR1\>",$strColour
    
            $strColour = "#ffffff"
    		$strHTMLRowNew = $strHTMLRowNew -Replace "\<LASTSTATUSREPORT\>",$_.LastStatusReport
    		$strHTMLRowNew = $strHTMLRowNew -Replace "\<COLOUR2\>",$strColour
    
    		$strHTMLRowNew = $strHTMLRowNew -Replace "\<LASTUPDATECREATION\>",$_.LastUpdateCreation
    		$strHTMLRowNew = $strHTMLRowNew -Replace "\<COLOUR3\>",$strColour
    
    		if ($_.ProductVersion -notmatch "5\.0\.8") {
    			$strColour = "#ffd700"
    		} Else {
    			$strColour = "#66CD00"
    		}
    		$strHTMLRowNew = $strHTMLRowNew -Replace "\<PRODUCTVERSION\>",$_.ProductVersion
    		$strHTMLRowNew = $strHTMLRowNew -Replace "\<COLOUR4\>",$strColour
            
    		if ($_.UpToDate -eq $False) {
    			$strColour = "#ff0000"
    		} Else {
    			$strColour = "#66CD00"
    		}
    		$strHTMLRowNew = $strHTMLRowNew -Replace "\<UpToDate\>",$_.UpToDate
    		$strHTMLRowNew = $strHTMLRowNew -Replace "\<COLOUR5\>",$strColour
            
    		$strCMSHTML = $strCMSHTML + $strHTMLRowNew
    	}
    
    	$strCMSHTML = $strCMSHTML + "</table>"
    
    	return $strCMSHTML
    }

    Also, I first prepare the "C:\test\S.txt" with the required server FQDNs. Like this:

    Server1.domain.com

    Server2.domain.com


    Best Regards,
    Shaw Lu


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.

    Thursday, August 1, 2019 9:05 AM
    Moderator
  • Hi Shaw Lu,

    Thank you very very much.

    The provided solution has resolved my long standing issue.

    Regards,

    Sudheer


    Thanks & Regards, Sudheer

    Wednesday, August 21, 2019 6:42 AM