Previous Next

Thread: How can I convert the following IIS WMI script code to vc++ code

Last post 08-11-2008 6:09 AM by Zhao Ji Ma - MSFT. 1 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (2 items)

Sort Posts:

  • 08-05-2008, 3:46 AM

    • veeran
    • Not Ranked
    • Joined on 08-05-2008, 7:43 AM
    • Posts 3

    How can I convert the following IIS WMI script code to vc++ code

    How can I convert the following WMI script code to vc++ code

    Set oIIS = GetObject("winmgmts:root\WebAdministration")

    LikepLocator->ConnectServer(L"root\WebAdministration",                           NULL,                           NULL,                          

    NULL,

     0,

    NULL ,                         

     NULL,

     pService);

     

    Set oBinding = oIIS.Get("BindingElement").SpawnInstance_
    oBinding.BindingInformation = "*:80:" & siteName
    oBinding.Protocol = "http"

    Set oBinding2 = oIIS.Get("BindingElement").SpawnInstance_
    oBinding2.BindingInformation = "*:80:www." & siteName
    oBinding2.Protocol = "http"
    arrBindings = array(oBinding, oBinding2)

    Set oSiteDefn = oIIS.Get("Site")
    oSiteDefn.Create siteName, arrBindings, physicalPath
    WScript.Echo "Site created"
     Set oAppDefn = oIIS.Get("ApplicationPool.Name='" & appPoolName & "'")
    oAppDefn.ProcessModel.IdentityType = 3
    oAppDefn.ProcessModel.Username = appPoolUserName
    oAppDefn.ProcessModel.Password = appPoolPassword
    oAppDefn.Put_

    WScript.Echo "Identity set for App Pool"

    Set oSiteDefn = oIIS.Get("Site.Name='" & siteName & "'")
    oSiteDefn.ApplicationDefaults.ApplicationPool = appPoolName
    oSiteDefn.Put_

    please provide any sample code or related Links

  • 08-11-2008, 6:09 AM In reply to

    Re: How can I convert the following IIS WMI script code to vc++ code

    Hi,

    I think you can follow this MSDN code:

    http://msdn.microsoft.com/en-us/library/aa390421(VS.85).aspx

    Zhao Ji Ma
    Sincerely,
    Microsoft Online Community Support

    “Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
Page 1 of 1 (2 items)
Page view counter