Is it possible to change and element's IP address from an automation script and if yes and example please.
Thanks
Jeff this can be done with SLNet.
Element element = engine.FindElement("ElementName"); if (element != null) { GetLiteElementInfo getElementInfo = new GetLiteElementInfo { DataMinerID = element.DmaId, ElementID = element.ElementId, IncludeStopped = true }; LiteElementInfoEvent currentElementInfo = engine.SendSLNetSingleResponseMessage(getElementInfo) as LiteElementInfoEvent; if (currentElementInfo != null) { if (!string.IsNullOrWhiteSpace(currentElementInfo.Name)) { currentElementInfo.PortInfo[0].PollingIPPort = "222.222.222.222"; // Connection 1 //currentElementInfo.PortInfo[1].PollingIPPort = "222.222.222.222"; // Connection 2 //currentElementInfo.PortInfo[2].PollingIPPort = "222.222.222.222"; // Connection ... AddElementMessage addUpdateElement = new AddElementMessage { AlarmTemplate = currentElementInfo.AlarmTemplate, CreateDVEs = currentElementInfo.CreateDVEs, DataMinerID = currentElementInfo.DataMinerID, Description = currentElementInfo.Description, ElementID = currentElementInfo.ElementID, ElementName = currentElementInfo.Name, HostingDataMinerID = currentElementInfo.HostingAgentID, IsHidden = currentElementInfo.Hidden, IsReadOnly = currentElementInfo.IsReadOnly, IsReplicationActive = currentElementInfo.IsReplicated, KeepOnline = currentElementInfo.KeepOnline, Ports = currentElementInfo.PortInfo, ProtocolName = currentElementInfo.Protocol, ProtocolVersion = currentElementInfo.ProtocolVersion, State = currentElementInfo.State, TrendTemplate = currentElementInfo.TrendTemplate, Type = currentElementInfo.Type }; engine.SendSLNetSingleResponseMessage(addUpdateElement); } } }
Moderator note: Note that this is not officially supported and we cannot guarantee that it will still work in the future. As a rule, you should avoid using SLNet calls, as these are subject to change without notice.