For an application that is interacting with different webservers and
platforms I now need to interact with Microsoft IIS.

My goal is 'simple', retrieve a list of websites with a https binding, via

After some googling it looks like I need to use
the Microsoft.Web.Administration.dll that provides some classes that would
allow me todo the job:

*The Microsoft.Web.Administration namespace contains classes that a
developer can use to administer IIS Manager. With the classes in this
namespace, an administrator can read and write configuration information to
ApplicationHost.config, Web.config, and Administration.config files.*

*The classes in the Microsoft.Web.Administration namespace contain a series
of convenient top-level objects that allow the developer to perform
administrative tasks. The different logical objects available include
sites, applications, application pools, application domains, virtual
directories, and worker processes. You can use the API to obtain and work
with the configuration and state of these objects and to perform such
actions as creating a site, starting or stopping a site, deleting an
application pool, recycling an application pool, and even unloading
application domains.*

The namespace documentation on the msdn website:

And some (old) usage examples:

Now would it be a few minutes work to build something like this in the by
Microsoft supported languages but I hope someone could help me started in
golang as I can't find a lot of documentation or examples for this (besides w32
wrapper <https://github.com/AllenDang/w32> that looks really good!).

Loading the ddl is simple and completes successfully:
mwadmin =

But then I need to find a procedure:
mwadminSite = mwadmin.MustFindProc("SiteCollection")

Which always results in an error like this:
panic: Failed to find Microsoft.Web.Administration procedure in
c:\Windows\System32\inetsrv\Microsoft.Web.Administration.dll: The specified
procedure could not be found.

Now I think that I can't load a class as a procedure... but how can I use
this .dll then as I can't find any other way to get started with a dll file
by linking a procedure with MustFindProc, FindProc or Find in combination
with the NewLazyDLL delayed loading.

My full example code :-)

package main

import (

var (
mwadmin =
mwadminSite = mwadmin.MustFindProc("Microsoft.Web.Administration")

func main() {

You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 6 | next ›
Discussion Overview
groupgolang-nuts @
postedAug 24, '13 at 8:15a
activeAug 24, '13 at 10:33a



site design / logo © 2022 Grokbase