Powershell For SCR Replication Health

Hello Everyone - 
I have a script that I found from the web and wanted to use it to help send us email notifications on the status of our SCR replication health. We have 8 SCR Storage groups being replicated from 2 different email servers (4 from each server) and I wanted
to if someone can help me figure out how to make it so it reads from both servers vs creating the below script 8 times and getting 8 separate emails. The script is below
$SCRStatus = Get-StorageGroupCopyStatus -Server Server1 -StandbyMachine SCRServer |  Where {$_.StorageGroupName -eq “SG1”} 
if ($SCRStatus.SummaryCopyStatus -eq “Healthy”) 
$MessageBody = “The SCR for ” + $SCRStatus.StorageGroupName + " is Healthy” 
$FromAddress = “Exchange SCR Health <[email protected]>” 
$ToAddress = “[email protected]” 
$MessageSubject = “SCR Status” 
$SendingServer = “ServerName” 
$SMTPMessage = New-Object System.Net.Mail.MailMessage $FromAddress, $ToAddress, $MessageSubject, $MessageBody 
$SMTPMessage.IsBodyHtml = $true 
$SMTPClient = New-Object System.Net.Mail.SMTPClient $SendingServer 
$SMTPClient.Send($SMTPMessage) 
Else 
$MessageBody = “The SCR for ” + $SCRStatus.StorageGroupName + " has Failed” 
$FromAddress = “Exchange SCR Health <[email protected]>” 
$ToAddress = “[email protected]” 
$MessageSubject = “SCR Status” 
$SendingServer = “ServerName” 
$SMTPMessage = New-Object System.Net.Mail.MailMessage $FromAddress, $ToAddress, $MessageSubject, $MessageBody 
$SMTPMessage.IsBodyHtml = $true 
$SMTPClient = New-Object System.Net.Mail.SMTPClient $SendingServer 
$SMTPClient.Send($SMTPMessage) 

Hi,
Just change the server you're pointing at (-Server) and adjust the Where clause as necessary for each iteration. That'll be the quickest fix.
Alternatively you can use ForEach-Object and loop.
Don't retire TechNet! -
(Don't give up yet - 13,085+ strong and growing)
Thanks for the quick reply. Server 1 has 4 sg on it that I would love for it to pull. If I did a ForEach-object and loop how would that look? I am not that great at scripting lol

Similar Messages

  • Monitor Replication Health in Failover Cluster Manager?

    Have two Hyper-V 2012 R2 Clusters.
    One Cluster contains all production VM's.The second cluster is on another location and is intended only for HA purposes. All production VM's from the first clusters should be replicated to the other cluster.
    What is the best way to monitor the replication health of all VM's? In Failover Cluster manager, it's not possible to add a column "replication health" to the "roles" window. It's not practical to click on every VM to view the replication
    health. In Hyper-V Manager, it's easy to add "replication health" to the virtual machine window, but clicking on every host to verify the replication health is not very practical as well.
    Thank you in advance for any hint (I know that we could use SCOM or something similar, but these complex tools are out of scope).
    Franz

    Hi FranzSchenk
    I think the only real option open to you is the use of PowerShell in your situation. Have a look at this link and see if this is the sort of thing that will help you.
    http://www.serverwatch.com/server-tutorials/checking-hyper-v-replication-health-using-powershell-cmdlets.html
    Kind Regards
    Michael Coutanche
    Blog:   
    Twitter:   LinkedIn:
    Note: Posts are provided “AS IS” without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

  • DFSR - This member is waiting for initial replication for replicated folder SYSVOL Share - How long should it take?

    Yesterday we were forced to perform a non-authoritative sync of the SYSVOL folder as replication had stopped because one of the DCs had been disconnected from it's replication partner for more than 60 days (caused by a unexpected shutdown and we did not
    pick up on the fact replication had stopped until now).
    I performed the non-authoritative sync of the SYSVOL folder and now the folder is in state 2
    ReplicatedFolderName  ReplicationGroupName  State
    SYSVOL Share          Domain System Volume  2
    and has been for more than 12 hours.  The DFS replication health report, reports "This member is waiting for initial replication for replicated folder SYSVOL Share".
    How long should it take and is there anyway to force it so that replication can resume?

    I'm fairly sure it's not tombstoned.  Here is the DCDIAG output:
    Directory Server Diagnosis
    Performing initial setup:
       Trying to find home server...
       Home Server = RC-CURDC-02
       * Identified AD Forest. 
       Done gathering initial info.
    Doing initial required tests
       Testing server: Default-First-Site-Name\RC-CURDC-02
          Starting test: Connectivity
             ......................... RC-CURDC-02 passed test Connectivity
    Doing primary tests
       Testing server: Default-First-Site-Name\RC-CURDC-02
          Starting test: Advertising
             ......................... RC-CURDC-02 passed test Advertising
          Starting test: FrsEvent
             ......................... RC-CURDC-02 passed test FrsEvent
          Starting test: DFSREvent
             There are warning or error events within the last 24 hours after the
             SYSVOL has been shared.  Failing SYSVOL replication problems may cause
             Group Policy problems. 
             ......................... RC-CURDC-02 passed test DFSREvent
          Starting test: SysVolCheck
             ......................... RC-CURDC-02 passed test SysVolCheck
          Starting test: KccEvent
             ......................... RC-CURDC-02 passed test KccEvent
          Starting test: KnowsOfRoleHolders
             ......................... RC-CURDC-02 passed test KnowsOfRoleHolders
          Starting test: MachineAccount
             ......................... RC-CURDC-02 passed test MachineAccount
          Starting test: NCSecDesc
             ......................... RC-CURDC-02 passed test NCSecDesc
          Starting test: NetLogons
             ......................... RC-CURDC-02 passed test NetLogons
          Starting test: ObjectsReplicated
             ......................... RC-CURDC-02 passed test ObjectsReplicated
          Starting test: Replications
             ......................... RC-CURDC-02 passed test Replications
          Starting test: RidManager
             ......................... RC-CURDC-02 passed test RidManager
          Starting test: Services
             ......................... RC-CURDC-02 passed test Services
          Starting test: SystemLog
             A warning event occurred.  EventID: 0x000003FC
                Time Generated: 06/12/2014   18:26:05
                Event String:
                Scope, 10.59.96.64, is 83 percent full with only 7 IP addresses remaining.
             A warning event occurred.  EventID: 0x000003FC
                Time Generated: 06/12/2014   18:26:05
                Event String:
                Scope, 10.59.98.0, is 95 percent full with only 5 IP addresses remaining.
             A warning event occurred.  EventID: 0x00000560
                Time Generated: 06/12/2014   18:26:05
                Event String:
                IP address range of scope 10.59.96.64 is 83 percent full with only 7 IP addresses available.
             A warning event occurred.  EventID: 0x00000560
                Time Generated: 06/12/2014   18:26:05
                Event String:
                IP address range of scope 10.59.98.0 is 95 percent full with only 5 IP addresses available.
             A warning event occurred.  EventID: 0x000016AF
                Time Generated: 06/12/2014   18:39:43
                Event String:
                During the past 4.23 hours there have been 95 connections to this Domain Controller from client machines whose IP addresses don't map to any of the existing sites in the enterprise. Those clients, therefore, have undefined
    sites and may connect to any Domain Controller including those that are in far distant locations from the clients. A client's site is determined by the mapping of its subnet to one of the existing sites. To move the above clients to one of the sites, please
    consider creating subnet object(s) covering the above IP addresses with mapping to one of the existing sites.  The names and IP addresses of the clients in question have been logged on this computer in the following log file '%SystemRoot%\debug\netlogon.log'
    and, potentially, in the log file '%SystemRoot%\debug\netlogon.bak' created if the former log becomes full. The log(s) may contain additional unrelated debugging information. To filter out the needed information, please search for lines which contain text
    'NO_CLIENT_SITE:'. The first word after this string is the client name and the second word is the client IP address. The maximum size of the log(s) is controlled by the following registry DWORD value 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Netlogon\Parameters\LogFileMaxSize';
    the default is 20000000 bytes.  The current maximum size is 20000000 bytes.  To set a different maximum size, create the above registry value and set the desired maximum size in bytes.
             ......................... RC-CURDC-02 passed test SystemLog
          Starting test: VerifyReferences
             ......................... RC-CURDC-02 passed test VerifyReferences
       Running partition tests on : curriculum
          Starting test: CheckSDRefDom
             ......................... curriculum passed test CheckSDRefDom
          Starting test: CrossRefValidation
             ......................... curriculum passed test CrossRefValidation
       Running partition tests on : Schema
          Starting test: CheckSDRefDom
             ......................... Schema passed test CheckSDRefDom
          Starting test: CrossRefValidation
             ......................... Schema passed test CrossRefValidation
       Running partition tests on : Configuration
          Starting test: CheckSDRefDom
             ......................... Configuration passed test CheckSDRefDom
          Starting test: CrossRefValidation
             ......................... Configuration passed test CrossRefValidation
       Running enterprise tests on : riddlesdown.local
          Starting test: LocatorCheck
             ......................... riddlesdown.local passed test LocatorCheck
          Starting test: Intersite
             ......................... riddlesdown.local passed test Intersite
    Eveything is passing, except for the bits about the SystemLog and DFRS, all seems good to me.
    Event 2213 is in the logs.  I will look and changing the MaxOfflineTimeInDays and see if that gets it going.

  • In what case, we need to use PI for vendor replication in MM-SUS?

    Dear Experts,
    In what scenarios, we need to use or configure the PI settings for vendor replication between MM and SUS? The SAP configuration guide for SRM 7.01 mentions about the PI settings for vendor replication from ECC to SUS.
    However, we are able to replicate the vendor from ECC to SUS using the program BBPGETVD in SUS client?
    In what circumstances, we need to configure the PI settings for vendor replication when we are able to do so in a much simpler way?
    Thanks in advance,
    Ranjan
    Ranjan Sutradhar

    Hi Ranjan,
    In all circumstances you need to replicate vendors from MM to SUS via PI. BBPGETVD is not the right way to replicate vendors to SUS because the information like vendor class, assignment of this vendor class to an object and the vendor classification cannot be transferred via BBPGETVD.
    Hence you will have to use PI. You can try sending a PO from MM to SUS and the PO will fail in SUS with a message like 'Vendor not present in SUS' if you use BBPGETVD.
    Regards,
    Nikhil

  • Middleware-Filter settings for the replication of BP from CRM to R/3

    Hi Experts,
    Can we set filter criteria for the replication of BP's from CRM to R/3 in the delta load.If so how can we achieve it.
    Points will be rewarded.
    Thanks in advance
    Nadh.

    Dear Nadh,
    Pls go through the followings:
    http://help.sap.com/bestpractices/crossindustry/crm/v240/BBLibrary/Documentation/B09_BB_ConfigGuide_EN_US.doc
    http://help.sap.com/bestpractices/BBLibrary/documentation/D63_BB_ConfigGuide_EN_UK.doc
    http://help.sap.com/bp_crmv250/CRM_DE/BBLibrary/html/BBlibrary.htm
    C03
    Thanks,
    Atin

  • PowerShell for Office 365 is here – here's how to use it

    After announcing its intention to release new scripts and commands to better integrate PowerShell with Office 365,Microsoft has followed through.The newly ordained PowerShell for Office 365 features the same command-line interface found in PowerShell 5.0 – and that's because it is the same program.According to The Register, Microsoft has created "ascript libraryto help you do things like add users, control licenses, and stop people from recording Skype meetings."Before you start using it, however, you have to "import the modules corresponding to all the bits of Office 365 you want to administer, including the Microsoft Online Services Sign-in Assistant and the Azure Active Directory Module to handle the important matters of security and authentication."The widespread use of PowerShell and its necessity for sysadmins and network admins...
    This topic first appeared in the Spiceworks Community

    Hi, almightywiz,
    Sorry for the delayed response. I was away from office for one day and did not have access to the files.
    And you are right, column 11 is text and column 26 is date (i.e., numeric). And indeed, those visually blank cell in column 11 are not null but have zero length. Java can tell the difference but not by visually inspecting the cells in the spreadsheet.
    I also checked the POI API documents, and found that org.apache.poi.ss.usermodel.Cell interface, which has those cell types, is implemented by both HSSFCell and XSSFCell. The question is under what condition the cell type of a cell becomes Cell.CELL_TYPE_BLANK.
    While that is not yet clear, I will catch cells missing data in column 11 by checking three things: first check if(cell == null), then if(cell.getCellType() != Cell.CELL_TYPE_STRING), and then if(cell.getStringCellValue().length() == 0). And that solves my problem.
    Thank you so much for sharing your experience and solving my problem.
    I have another problem that may more serious, at Can I process Excel BIFF5 files, or simply abandon Apache POI? It would be very much appreciated if you had time to look at it.
    Best regards,
    Newman

  • 1:N Replication Health Check

    Hello,
    When we run the check of 1:N Replication Health Check  We are getting the following:
    We cant replicate the tables mentioned in this report.
    How should we proceed to fix this issue?
    Thanks,
    Amir

    Hi Roy,
    look at this note. it describes how to setup 1:n once you already created the config without "multiple usage" flagged.
    Best,
    Tobias
    SAP Note 1898479:
    SLT replication: Redefinition of existing DB triggers

  • Does replication group have to be set for session replication

    I have delployed an servlet based application on a 3 node cluster. I have a simple POJO that I use to carry data in the session from a "confirm?" to "confirmed" page. This object implements serializable and only has String and int members. I put it in session using request.getSession().setAttribute("dto", myobject). For some reason it is not being replicated to the other nodes in the cluster. My weblogic.xml has "PersistentStoreType" set to "replicated_if_clustered". I am not seeing any serialization or other errors in the node logs.
              I have looked at information contained in the link below and I think we are doing everything right. http://support.bea.com/application_content/product_portlets/support_patterns/wls/HTTP_Session_Replication_Failures_Pattern.html
              The only thing that I noticed is that the "Replication Group" is not set for any of the servers in the cluster. Does this need to be set for replication to happen?

    Hi,
              Having replication group is optional. It is used only if you are implementing failover in cluster. For session replication one has to generally configure 3 things:
              - in memory replication
              - jdbc replication
              - file sytem replication
              for im memory replication,
              Step 1:
              make sure taht a client is accesing the cluseter using either
              - load balancing hardware
              - web servers with weblogic proxy plugin
              Step 2:
              specify the persistance type in weblogic.xml
              Thanks,
              Sushma

  • Why we need crm middleware for material replication?

    Hi Experts,
    Why we need CRM middleware for material replication from ECC to SRM when we can do the vendor replication from ECC to SRM with ABAP report? IS there any technical limitation?
    Thanks and regards,
    Ranjan

    Hello,
    Vendors and locations, for example, you can replicate from ECC to SRM using ABAP reports.
    However, if you want to replicate the following information, you should use the middleware:
    - DNL-CUST-BASIS3 - Basis CRM online
    - DNL-CUST-PROD0 - Material number conversions
    - DNL-CUST-PROD1 - Product : categories
    - DNL_CUST_SRVMAS - Customizing: Service Master
    - MATERIAL - R/3 Material Master
    - SERVICE_MASTER - R/3 Service Master
    Check note 872533. It provides more information.
    Regards,
    Ricardo

  • Is there a template for objects to include/exclude for backups/replication?

    Hi,
    I was wondering anyone has a template posted somewhere of what IFS directories/files to include and/or exclude on backups and also for MIMIX replication(I assume they would be the same list).
    I could just exclude of les that error, but I would like to be more certain that the entire Java directory isconsistant in case of a restore. It  seems that our list of files  that are in use has grown quite a bit since Java was installed.
    Thanks,
    Craig.

    See notes
    825473
    214369
    We use DataMirror's iCluster product, which works similarly to MIMIX.
    Some of the same considerations apply for doing backups, especially backups with save-while-active, which are also discussed in the notes.
    Good luck
    Brian
    Expand message
    Message was edited by:
            Brian Sammond

  • ERP System ID is not appearing for Manual Replication upload in Properties

    Customer are uploading data for manual replication they are unable to select the ERP as the source system ID since it is not appearing in the drop down menu.

    Hi,
    prerequisite for selectiong a source system is that a system including a system instance is defined. If it is a SAP business suite system it must be defined as such. If not you need to select a non-SAP system in the properties of the uploaded file.
    Best regards, Reinhard

  • Why do we need to define RFC destination and user for material replication

    Dear Experts,
    why do we need to define RFC destination and user for material replication? Here we use crm middleware only for material replication. Could you please help me to understand it?
    regards,
    Ranjan

    Hello,
    As far as I know, you can use the same RFC destination already available in ECC to SRM to replicate materials.
    You can refer to note 720819.
    Regards,
    Ricardo

  • SRM 7.0 - CRM middleware settigns for material replication

    Hello SRM Guru's
    Can you please provide me detail step by step process of CRM middleware settings for material replication from ECC 6.0 SRM 7.0?
    Thanks.
    Regards,
    Magesh.

    Hi,
    Configuration Guides are available in SAP Solution Manager Server. Downloaded offline version is also available in SAP Service Marketplace. http://service.sap.com/srm-inst
    Please check a good blog by Marcin Gajewski. /people/marcin.gajewski/blog/2007/02/05/how-to-replicate-material-master-from-r3-to-srm
    SDN has search functions. You can find solutions for your issue.
    Regards,
    Masa

  • L3 Link for Storage Replication

    Hi,
    Has anyone experienced on provisioning L3 MPLS link for Storage Replication.  I have two DC at different location and EMC Storage.
    we will have 2 MPLS L3 Link between two DCs to replicate the data.  We have 4 RPA at each side and 2 MPLS Link.  but dont have idea how to connect all these things.  I have Nexus 7k in new DC and 6509 in old DC.
    If anyone has any idea how to provisioned this link, it would great help to me.

    Hi Micky,
    Such table doesn´t exist in standard SAP! You should try to accomplish this in a view!

  • How to create sharepoint Group with read only permissions using powershell for entire site ?

    How to create sharepoint Group with read only permissions using powershell for entire site (including subsites and top level site)

    Hi
    using (SPSite site = new SPSite(url))
    using (SPWeb web = site.OpenWeb())
    SPUserCollection users = Web.AllUsers;
    SPUser owner = users[string.Format("{0}{1}", "Domain", "Owner Username")];
    SPMember member = users[string.Format("{0}{1}", "Domain", "Default Member Username")];
    SPGroupCollection groups = Web.SiteGroups;
    string GroupName = “Super Exclusive”;//your group name
    string GroupDescription = “Super exclusive group description.”;
    groups.Add(GroupName, owner, member, GroupDescription);
    SPGroup NewSPGroup = groups[GroupName];
    SPRoleDefinition role = Web.RoleDefinitions["Read"];
    SPRoleAssignment roleAssignment = new SPRoleAssignment(NewSPGroup);
    roleAssignment.RoleDefinitionBindings.Add(role);
    Web.RoleAssignments.Add(roleAssignment);
    Web.Update();
    Please 'propose
    as answer' if it helped you, also 'vote
    helpful' if you like this reply.

Maybe you are looking for

  • Remote Key Mapping - Maintanance

    Hi All, I have Auto Id field in my repository; I would like to maintain this as my remote key value in my key mapping table ( automatically) in the following scenarios: 1. Initial Loading 2. On going ( from portal) 3. Manual creating a record The iss

  • How to repaint a panel

    Hi All! I am trying to display a few textFields in an AWT applet. The number of textFields I need to set is variable. I want to repaint a portion of an applet (the panel in which these textFields are placed) when a button is clicked. In the code belo

  • HT4208 When I tap the Apple store, youtube and the itunes apps on my iPad they do not open. Any help with this please?

    When I tap the Apple store, YouTube and the iTunes apps, they don' launch. Any help with this?

  • Dreamweaver MX with Vista

    I recently upgraded to Windows Vista Ultimate 32 bits and installed DW MX...ever since, I cannot create Tables using the icons within dreamweaver...I have to go into the source code and type in the tags and all! Much easier and faster to just use the

  • BEx not refreshing data on all embedded queries:One variable, one variant:

    Good day I have the following challenge. I have created a BEx workbook and inserted one query multiple times into this workbook. I have removed the result area of each query to a separate sheet to enable the use of different filter values and to use