We can try to answer it here but the DS experts are amazing over @
http://groups.yahoo.com/group/ADSIANDDirectoryServices


On Mon, 17 Jan 2005 20:13:59 -0800 (PST), CN YEONG <[EMAIL PROTECTED]> wrote:
>  Hi.
>  This error is regarding the page in microsoft web site :
>  
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iissdk/iis/setting_ip_security_using_system_directoryservices.asp
>  
>  I follow exactly the topic adding the reference Active DS IIS Namespace
> Provider in Visual Studio .NET. I am using Windows Server SBS 2003 and using
> Visual Studio .NET 2003 to run this coding.
>  
>  
>  [C#]using System;using System.DirectoryServices;using
> System.Reflection;namespace ADSI1{  /// <summary>  /// Small class
> containing methods to configure IIS.  /// </summary>  class ConfigIIS  {   
> /// <summary>    /// The main entry point for the application.    ///
> </summary>    [STAThread]    static void Main(string[] args)    {     
> string serverName = "localhost";      string password =
> "<Administrative_Password>";      IpSecurity(serverName, password);    }   
> static void IpSecurity(string serverName, string password)    {     
> DirectoryEntry defaultRoot = new DirectoryEntry("IIS://" + serverName +
> "/w3svc/1/root",serverName + "\\administrato r",
> password,AuthenticationTypes.Secure);      PropertyValueCollection
> ipSecValCollection = defaultRoot.Properties["IPSecurity"];     
> IISOle.IPSecurityClass ipSecClass = new IISOle.IPSecurityClass();     
> ipSecClass.GrantByDefault = true;      ipSecClass.IPDeny =
> "123.0.0.1,255.255.255.0";      ipSecClass.DomainDeny = "iis-test";     
>  ipSecValCollection.Add( ipSecClass);      defaultRoot.CommitChanges();    }
>  }}
>  
>  
>  
>  
>  
>  When compiling this coding,everything go fine.But when execute this
> coding,it come out a error message like this :
>  
>  An unhandled exception of type
> 'System.Runtime.InteropServices.COMException' occurred in
> WindowsApplication1.exe
>  
>  Additional information: COM object with CLSID
> {F3287520-BBA3-11D0-9BDC-00A0C922E703} is either not valid or not
> registered.
>  
>  Any Idea?Thanks for help.
>  
>  
>  __________________________________________________
>  Do You Yahoo!?
>  Tired of spam?  Yahoo! Mail has the best spam protection around 
>  http://mail.yahoo.com 
>  
>  [Non-text portions of this message have been removed]
>  
>  
>  ________________________________
>  Yahoo! Groups Links
>  
> To visit your group on the web, go to:
> http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
>   
> To unsubscribe from this group, send an email to:
> [EMAIL PROTECTED]
>   
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to