How to change IIS TCP port programmatically

How to change IIS TCP port programmatically

am 14.10.2007 04:21:01 von rasane

Hi,

I am looking for a way to change default IIS TCP port from say for eg. 80 to
8090. I need to be able to read the current setting and update it. I
understand how to do this using the MMC Snapin
(http://support.microsoft.com/default.aspx/kb/313072, section on "Configure
the IIS IP address and port").

I have searched high and low in the IIS administration interface:
http://www.microsoft.com/technet/prodtechnol/WindowsServer20 03/Library/IIS/cde669f1-5714-4159-af95-f334251c8cbd.mspx?mfr =true

and in IIS Metabase properties listed at:
http://www.microsoft.com/technet/prodtechnol/WindowsServer20 03/Library/IIS/cde669f1-5714-4159-af95-f334251c8cbd.mspx?mfr =true

I need to do this in C++, but any example in any scripting for a start is
accpetable.

Thanks in Advance

Re: How to change IIS TCP port programmatically

am 14.10.2007 12:14:35 von Kristofer Gafvert

You want to change the ServerBindings property:
http://www.microsoft.com/technet/prodtechnol/WindowsServer20 03/Library/IIS/cde669f1-5714-4159-af95-f334251c8cbd.mspx?mfr =true

I have an example that works with the ServerBindings property in C#. It
does almost what you want to do.

http://www.gafvert.info/iis/article/cs_add_host_header.htm

--
Regards,
Kristofer Gafvert
http://www.gafvert.info/iis/ - IIS Related Info


rasane wrote:

>Hi,
>
>I am looking for a way to change default IIS TCP port from say for eg. 80
>to
>8090. I need to be able to read the current setting and update it. I
>understand how to do this using the MMC Snapin
>(http://support.microsoft.com/default.aspx/kb/313072, section on "Configure
>the IIS IP address and port").
>
>I have searched high and low in the IIS administration interface:
>http://www.microsoft.com/technet/prodtechnol/WindowsServer2 003/Library/IIS/cde669f1-5714-4159-af95-f334251c8cbd.mspx?mf r=true
>
>and in IIS Metabase properties listed at:
>http://www.microsoft.com/technet/prodtechnol/WindowsServer2 003/Library/IIS/cde669f1-5714-4159-af95-f334251c8cbd.mspx?mf r=true
>
>I need to do this in C++, but any example in any scripting for a start is
>accpetable.
>
>Thanks in Advance

Re: How to change IIS TCP port programmatically

am 15.10.2007 02:16:00 von rasane

Hi Kristofer,

Thank you very much..
ServerBindings is the right property. (link:
http://www.microsoft.com/technet/prodtechnol/WindowsServer20 03/Library/IIS/cde669f1-5714-4159-af95-f334251c8cbd.mspx?mfr =true).

btw, It was tricky using MULTISZ in C++ until I read carefully about the
double null terminators and the single null terminators on a LPBYTE (2 null
bytes for each)!!

Regards,
rasane


"Kristofer Gafvert" wrote:

> You want to change the ServerBindings property:
> http://www.microsoft.com/technet/prodtechnol/WindowsServer20 03/Library/IIS/cde669f1-5714-4159-af95-f334251c8cbd.mspx?mfr =true
>
> I have an example that works with the ServerBindings property in C#. It
> does almost what you want to do.
>
> http://www.gafvert.info/iis/article/cs_add_host_header.htm
>
> --
> Regards,
> Kristofer Gafvert
> http://www.gafvert.info/iis/ - IIS Related Info
>
>
> rasane wrote:
>
> >Hi,
> >
> >I am looking for a way to change default IIS TCP port from say for eg. 80
> >to
> >8090. I need to be able to read the current setting and update it. I
> >understand how to do this using the MMC Snapin
> >(http://support.microsoft.com/default.aspx/kb/313072, section on "Configure
> >the IIS IP address and port").
> >
> >I have searched high and low in the IIS administration interface:
> >http://www.microsoft.com/technet/prodtechnol/WindowsServer2 003/Library/IIS/cde669f1-5714-4159-af95-f334251c8cbd.mspx?mf r=true
> >
> >and in IIS Metabase properties listed at:
> >http://www.microsoft.com/technet/prodtechnol/WindowsServer2 003/Library/IIS/cde669f1-5714-4159-af95-f334251c8cbd.mspx?mf r=true
> >
> >I need to do this in C++, but any example in any scripting for a start is
> >accpetable.
> >
> >Thanks in Advance
>