Previous Next

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

Last post 08-12-2008 4:31 AM by Zhao Ji Ma - MSFT. 3 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (4 items)

Sort Posts:

  • 08-05-2008, 3:45 AM

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

    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_

  • 08-07-2008, 1:49 AM In reply to

    • ywds2222
    • Not Ranked
    • Joined on 03-04-2008, 10:28 AM
    • Posts 8
    • ywds2222

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

     

    I'm afraid you need to convert it manually. we have done similar before, it will be much better if there is tool to do the same.

  • 08-07-2008, 2:08 AM In reply to

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

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

    With AppCMD you can do similar thing. But i need some sample VC++ code that uses WMI in the above script.

  • 08-12-2008, 4:31 AM In reply to

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

    You can see this.

    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 (4 items)
Page view counter