Previous Next

Thread: Unable To set the Application Name

Last post 08-01-2008 8:18 PM by junaid_Arif_mufti. 1 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (2 items)

Sort Posts:

  • 06-23-2008, 12:09 AM

    Unable To set the Application Name

    Hi

    I am writing an application to automate my IIS administration script but I have been stuck in this problem for quiet sometime now I want to setup the Application Name in my IIS 6.0. I use the following script for website creation.

     

    Dim w3svc As DirectoryEntry
    w3svc = New DirectoryEntry("IIS://" & IISServer & "/W3SVC")
    newsite = New Object() {ServerComment, IPPortHostName.ToArray(), DataFolderName}
    websiteId = w3svc.Invoke("CreateNewSite", newsite)
    w3svc.CommitChanges()
    w3svc.RefreshCache()
    w3svc.Close()
     

    I use the following function to set website properties. The AppFriendlyName property does get set properly as I am able to retrieve it later on. but in IIS Management Console the "Application Name" Textbox remains empty... Whyyy

     

    Public Sub SetWebSiteProperties(ByVal IISServer As String, ByVal WebsiteId As String, ByVal ApplicationName As String, ByVal LogInterval As String, ByVal ApplicationPool As String ByVal LimitBandwidth As String, ByVal ConnectionLimitedTo As String)
            Try
                Dim WebServerSchema As String = "IIsWebServer"
                Dim Site As DirectoryEntry = New DirectoryEntry("IIS://" & IISServer & "/w3svc/" & WebsiteId)
                If (Site.SchemaClassName = WebServerSchema) Then
                    Site.InvokeSet("AppFriendlyName", ApplicationName)
                    Site.Invoke("Put", "AccessRead", True)
                    Site.Invoke("Put", "AccessExecute", True)
                    Site.Invoke("Put", "MaxConnections", ConnectionLimitedTo)
                    Site.Invoke("Put", "LogFilePeriod", LogInterval)
                    Site.Invoke("Put", "MaxBandwidth", LimitBandwidth)
                    Site.Invoke("Put", "AppPoolId", ApplicationPool)
                    Site.CommitChanges()
                    Site.RefreshCache()
                End If
                Site.Close()
            Catch Err As Exception
                Throw
            End Try
        End Sub

  • 08-01-2008, 8:18 PM In reply to

    Re: Unable To set the Application Name

    Wrote this post 2 months back... It was waiting moderators approval for nearly 70 days and tonight out of the blue my post has been accepted my Microsoft.

    I say thank you so much; I am so grateful that my post has been honored by by the kind moderators at this forum...

Page 1 of 1 (2 items)
Page view counter