Example #1
0
        /// <summary>
        /// resets the IP addresses for secondary DNS Servers in the zone.
        /// </summary>
        /// <param name="secondaryServers">Array of IP addresses for secondary DNS Servers.</param>
        /// <param name="secureSecondaries">Specifies the security to be applied </param>
        /// <param name="notifyServers">IP address of DNS Servers to be notified when the zone changes.</param>
        /// <param name="notify">Notification setting and must be one of the following: </param>
        /// <returns>Zone</returns>
        public Zone ResetSecondaries(string[] secondaryServers, SecondarySecurityEnum secureSecondaries,
                                     string[] notifyServers,
                                     NotifyLevelEnum notify)
        {
            ManagementBaseObject inParams = m_mo.GetMethodParameters("ResetSecondaries");

            inParams["SecondaryServers"]  = secondaryServers;
            inParams["SecureSecondaries"] = (UInt32)secureSecondaries;
            inParams["NotifyServers"]     = notifyServers;
            inParams["Notify"]            = (UInt32)notify;

            //return new Zone(new ManagementObject(m_mo.Scope, new ManagementPath(m_mo.InvokeMethod("ResetSecondaries", inParams, null)["RR"].ToString()), null));


            //ResetSecondaries not acting as documented in
            //http://msdn.microsoft.com/en-us/library/windows/desktop/ms682765(v=vs.85).aspx
            try
            {
                m_mo.InvokeMethod("ResetSecondaries", inParams, null);//["RR"].ToString()

                return(new Zone(new ManagementObject(m_mo.Scope, new ManagementPath(m_mo.ToString()), null)));
            }
            catch (ManagementException me)
            {
                throw new WMIException(me);
            }
        }
Example #2
0
        /// <summary>
        /// resets the IP addresses for secondary DNS Servers in the zone.
        /// </summary>
        /// <param name="secondaryServers">Array of IP addresses for secondary DNS Servers.</param>
        /// <param name="secureSecondaries">Specifies the security to be applied </param>
        /// <param name="notifyServers">IP address of DNS Servers to be notified when the zone changes.</param>
        /// <param name="notify">Notification setting and must be one of the following: </param>
        /// <returns>Zone</returns>
        public Zone ResetSecondaries(string[] secondaryServers, SecondarySecurityEnum secureSecondaries,
                                     string[] notifyServers,
                                     NotifyLevelEnum notify)
        {
            ManagementBaseObject inParams = m_mo.GetMethodParameters("ResetSecondaries");
            inParams["SecondaryServers"] = secondaryServers;
            inParams["SecureSecondaries"] = (UInt32)secureSecondaries;
            inParams["NotifyServers"] = notifyServers;
            inParams["Notify"] = (UInt32)notify;

            //return new Zone(new ManagementObject(m_mo.Scope, new ManagementPath(m_mo.InvokeMethod("ResetSecondaries", inParams, null)["RR"].ToString()), null));

            //ResetSecondaries not acting as documented in
            //http://msdn.microsoft.com/en-us/library/windows/desktop/ms682765(v=vs.85).aspx
            try
            {
                m_mo.InvokeMethod("ResetSecondaries", inParams, null);//["RR"].ToString()

                return new Zone(new ManagementObject(m_mo.Scope, new ManagementPath(m_mo.ToString()), null));
            }
            catch (ManagementException me)
            {
                throw new WMIException(me);
            }
        }