Re: SMTP IPSecurity
From: Ralf Ziller (msmarv_at_dodgethis.de)
Date: 05/10/04
- Next message: Venkat Srinivasan.R: "RE: SMTP error"
- Previous message: Jeff Henkels: "Re: Export or display SMTP IPSecurity deny list"
- In reply to: Stephany: "SMTP IPSecurity"
- Next in thread: Stephany: "Re: SMTP IPSecurity"
- Reply: Stephany: "Re: SMTP IPSecurity"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 11 May 2004 00:49:25 +0200
"Stephany" <nospam@localhost> schrieb im Newsbeitrag
news:Od$6xjjMEHA.2716@tk2msftngp13.phx.gbl...
> What I would like to do is programatically add the address to the deny
list,
> but have not been able to figure out how to do this.
>
> The machine is question is running Windows 2000 Server (SP4) with Exchange
> Server 2000 (SP3) and the dev. tools of choice are C# or VB.NET (VS 2003).
>
> Can anyone provide a code fragment that will point me in the right
> direction?
The following C#-code uses System.Management, System.DirectoryServices and
System.Reflection
DirectoryEntry SMTPServer = new
DirectoryEntry("IIS://localhost/SMTPSVC/1");
SMTPServer.RefreshCache();
object oIPSecurity = SMTPServer.Invoke("Get", new string[]{"IPSecurity"});
Type t = oIPSecurity.GetType();
//Get the list of denied IPs
Array IPs = (Array)t.InvokeMember("IPDeny",
BindingFlags.GetProperty, null, oIPSecurity, null);
//create a new Array of IPs
object[] newIPs = new object[IPs.Length+1];
//copy the existing IPs to the new Array
IPs.CopyTo(newIPs,0);
//add a new value
newIPs.SetValue("192.168.0.21",IPs.Length);
//Set the new IPlist
t.InvokeMember("IPDeny",
BindingFlags.SetProperty, null, oIPSecurity, new object[]{newIPs});
SMTPServer.Invoke("Put", new object[]{"IPSecurity", oIPSecurity});
SMTPServer.CommitChanges();
- Next message: Venkat Srinivasan.R: "RE: SMTP error"
- Previous message: Jeff Henkels: "Re: Export or display SMTP IPSecurity deny list"
- In reply to: Stephany: "SMTP IPSecurity"
- Next in thread: Stephany: "Re: SMTP IPSecurity"
- Reply: Stephany: "Re: SMTP IPSecurity"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|