Hi,

As everybody knows, IIS 6.0 assigns unique IDs based on the specified web
site name. I have been developing an programmatic administration tool for
IIS 6.0 and I need the algorithm how IIS generates these identifiers. I have
been through MSDN and Google search but have nothing usable.

Re: IIS 6.0 Unique ID generation by David

David
Thu Nov 04 05:30:22 CST 2004

Using the administration APIs you can easily enumerate available websites,
locate ones matching your criteria, and retrieve its ID.

Can you please give the reason(s) why you need to be able to predict the
Website ID before creating the website? Are you also aware that you can
actually specify the ID for a website (you get an exception if the ID is
already used)?

Anyways, I cannot think of a reason why anyone needs to know the algorithm,
including Microsoft...

--
//David
IIS
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Sýfýrýncý Murat" <@> wrote in message
news:OkEMKMlwEHA.1512@TK2MSFTNGP12.phx.gbl...
Hi,

As everybody knows, IIS 6.0 assigns unique IDs based on the specified web
site name. I have been developing an programmatic administration tool for
IIS 6.0 and I need the algorithm how IIS generates these identifiers. I have
been through MSDN and Google search but have nothing usable.





Re: IIS 6.0 Unique ID generation by Sıfırıncı

Sýfýrýncý
Thu Nov 04 06:37:14 CST 2004

I am hosting multiple web sites on a w2k3 server and want to create web
sites through an application to reduce the time spent for web site creation.
In order to create new web sites I need to assign an empty ID for
System.DirectoryServices class, so that it can create a new web site with
that ID. I could easily enumerate used IDs and generate one that is not in
use and create the new site with that ID but I know MMC uses an algorithm to
generate IDs with respect to the ServerComment property (or website name)
and I want my aplication to use the same procedure for the sake of
compatibility. This is the reason.


"David Wang [Msft]" <someone@online.microsoft.com> wrote in message
news:enYZDkmwEHA.1396@tk2msftngp13.phx.gbl...
> Using the administration APIs you can easily enumerate available websites,
> locate ones matching your criteria, and retrieve its ID.
>
> Can you please give the reason(s) why you need to be able to predict the
> Website ID before creating the website? Are you also aware that you can
> actually specify the ID for a website (you get an exception if the ID is
> already used)?
>
> Anyways, I cannot think of a reason why anyone needs to know the
algorithm,
> including Microsoft...
>
> --
> //David
> IIS
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> //
> "Sýfýrýncý Murat" <@> wrote in message
> news:OkEMKMlwEHA.1512@TK2MSFTNGP12.phx.gbl...
> Hi,
>
> As everybody knows, IIS 6.0 assigns unique IDs based on the specified web
> site name. I have been developing an programmatic administration tool for
> IIS 6.0 and I need the algorithm how IIS generates these identifiers. I
have
> been through MSDN and Google search but have nothing usable.
>
>
>
>



Re: IIS 6.0 Unique ID generation by Paul

Paul
Thu Nov 04 14:44:27 CST 2004

PMJI, but what happened to the sensible, logical method of assigning W3SVC
IDs that IIS 5.0 had? Now that I've upgraded to IIS 6.0, I get what appear
to be random 10 digit W3SVC numbers when I create new websites. Makes it a
little more difficult for the human being (me) to locate web server logs,
etc. What were they thinking?

-- Paul




"David Wang [Msft]" <someone@online.microsoft.com> wrote in message
news:enYZDkmwEHA.1396@tk2msftngp13.phx.gbl...
> Using the administration APIs you can easily enumerate available websites,
> locate ones matching your criteria, and retrieve its ID.
>
> Can you please give the reason(s) why you need to be able to predict the
> Website ID before creating the website? Are you also aware that you can
> actually specify the ID for a website (you get an exception if the ID is
> already used)?
>
> Anyways, I cannot think of a reason why anyone needs to know the
> algorithm,
> including Microsoft...
>
> --
> //David
> IIS
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> //
> "Sýfýrýncý Murat" <@> wrote in message
> news:OkEMKMlwEHA.1512@TK2MSFTNGP12.phx.gbl...
> Hi,
>
> As everybody knows, IIS 6.0 assigns unique IDs based on the specified web
> site name. I have been developing an programmatic administration tool for
> IIS 6.0 and I need the algorithm how IIS generates these identifiers. I
> have
> been through MSDN and Google search but have nothing usable.
>
>
>
>



Re: IIS 6.0 Unique ID generation by Bernard

Bernard
Thu Nov 04 22:21:28 CST 2004

This is for security, so that attackers are unable to guess. say if I have
two website, it won't be site id 1 and 2. it can be anything ...
read -
IIS 6.0: Web Site Identification Numbers Are Not Incremental
http://support.microsoft.com/?id=332122

--
Regards,
Bernard Cheah
http://www.tryiis.com/
http://support.microsoft.com/
http://www.msmvps.com/bernard/



"Paul" <paule@nospam-mindspring.com> wrote in message
news:#YEfg8qwEHA.3492@TK2MSFTNGP11.phx.gbl...
> PMJI, but what happened to the sensible, logical method of assigning W3SVC
> IDs that IIS 5.0 had? Now that I've upgraded to IIS 6.0, I get what
appear
> to be random 10 digit W3SVC numbers when I create new websites. Makes it
a
> little more difficult for the human being (me) to locate web server logs,
> etc. What were they thinking?
>
> -- Paul
>
>
>
>
> "David Wang [Msft]" <someone@online.microsoft.com> wrote in message
> news:enYZDkmwEHA.1396@tk2msftngp13.phx.gbl...
> > Using the administration APIs you can easily enumerate available
websites,
> > locate ones matching your criteria, and retrieve its ID.
> >
> > Can you please give the reason(s) why you need to be able to predict the
> > Website ID before creating the website? Are you also aware that you can
> > actually specify the ID for a website (you get an exception if the ID is
> > already used)?
> >
> > Anyways, I cannot think of a reason why anyone needs to know the
> > algorithm,
> > including Microsoft...
> >
> > --
> > //David
> > IIS
> > This posting is provided "AS IS" with no warranties, and confers no
> > rights.
> > //
> > "Sýfýrýnc?Murat" <@> wrote in message
> > news:OkEMKMlwEHA.1512@TK2MSFTNGP12.phx.gbl...
> > Hi,
> >
> > As everybody knows, IIS 6.0 assigns unique IDs based on the specified
web
> > site name. I have been developing an programmatic administration tool
for
> > IIS 6.0 and I need the algorithm how IIS generates these identifiers. I
> > have
> > been through MSDN and Google search but have nothing usable.
> >
> >
> >
> >
>
>



Re: IIS 6.0 Unique ID generation by Bernard

Bernard
Thu Nov 04 22:24:21 CST 2004

I'm not a dev guy. but I don't think it needs the ID to create the website.
take a look at the built-in script.

IISweb.vbs

try iisweb /create

it only ask you for the web root path, site description, ip, port, and host
header name.

--
Regards,
Bernard Cheah
http://www.tryiis.com/
http://support.microsoft.com/
http://www.msmvps.com/bernard/



"Sýfýrýnc?Murat" <@> wrote in message
news:eDLaotmwEHA.1512@TK2MSFTNGP12.phx.gbl...
> I am hosting multiple web sites on a w2k3 server and want to create web
> sites through an application to reduce the time spent for web site
creation.
> In order to create new web sites I need to assign an empty ID for
> System.DirectoryServices class, so that it can create a new web site with
> that ID. I could easily enumerate used IDs and generate one that is not in
> use and create the new site with that ID but I know MMC uses an algorithm
to
> generate IDs with respect to the ServerComment property (or website name)
> and I want my aplication to use the same procedure for the sake of
> compatibility. This is the reason.
>
>
> "David Wang [Msft]" <someone@online.microsoft.com> wrote in message
> news:enYZDkmwEHA.1396@tk2msftngp13.phx.gbl...
> > Using the administration APIs you can easily enumerate available
websites,
> > locate ones matching your criteria, and retrieve its ID.
> >
> > Can you please give the reason(s) why you need to be able to predict the
> > Website ID before creating the website? Are you also aware that you can
> > actually specify the ID for a website (you get an exception if the ID is
> > already used)?
> >
> > Anyways, I cannot think of a reason why anyone needs to know the
> algorithm,
> > including Microsoft...
> >
> > --
> > //David
> > IIS
> > This posting is provided "AS IS" with no warranties, and confers no
> rights.
> > //
> > "Sýfýrýnc?Murat" <@> wrote in message
> > news:OkEMKMlwEHA.1512@TK2MSFTNGP12.phx.gbl...
> > Hi,
> >
> > As everybody knows, IIS 6.0 assigns unique IDs based on the specified
web
> > site name. I have been developing an programmatic administration tool
for
> > IIS 6.0 and I need the algorithm how IIS generates these identifiers. I
> have
> > been through MSDN and Google search but have nothing usable.
> >
> >
> >
> >
>
>



Re: IIS 6.0 Unique ID generation by Kristofer

Kristofer
Fri Nov 05 03:16:49 CST 2004

Hello,

You can use IIsWebService.CreateNewSite to create new sites. This is new for
IIS 6.0.

I think the SDK is a bit vague on this, because the examples you can find
that creates new websites does not use this.

ADSI:
http://msdn.microsoft.com/library/en-us/iissdk/iis/iiswebservice_createnewsite.asp

WMI:
http://msdn.microsoft.com/library/en-us/iissdk/iis/ref_mof_iiswebservice_createnewsite.asp

Hope this answers your question.

--
Regards,
Kristofer Gafvert
http://www.ilopia.com


"Sýfýrýncý Murat" <@> wrote in message
news:eDLaotmwEHA.1512@TK2MSFTNGP12.phx.gbl...
> I am hosting multiple web sites on a w2k3 server and want to create web
> sites through an application to reduce the time spent for web site
creation.
> In order to create new web sites I need to assign an empty ID for
> System.DirectoryServices class, so that it can create a new web site with
> that ID. I could easily enumerate used IDs and generate one that is not in
> use and create the new site with that ID but I know MMC uses an algorithm
to
> generate IDs with respect to the ServerComment property (or website name)
> and I want my aplication to use the same procedure for the sake of
> compatibility. This is the reason.
>
>
> "David Wang [Msft]" <someone@online.microsoft.com> wrote in message
> news:enYZDkmwEHA.1396@tk2msftngp13.phx.gbl...
> > Using the administration APIs you can easily enumerate available
websites,
> > locate ones matching your criteria, and retrieve its ID.
> >
> > Can you please give the reason(s) why you need to be able to predict the
> > Website ID before creating the website? Are you also aware that you can
> > actually specify the ID for a website (you get an exception if the ID is
> > already used)?
> >
> > Anyways, I cannot think of a reason why anyone needs to know the
> algorithm,
> > including Microsoft...
> >
> > --
> > //David
> > IIS
> > This posting is provided "AS IS" with no warranties, and confers no
> rights.
> > //
> > "Sýfýrýncý Murat" <@> wrote in message
> > news:OkEMKMlwEHA.1512@TK2MSFTNGP12.phx.gbl...
> > Hi,
> >
> > As everybody knows, IIS 6.0 assigns unique IDs based on the specified
web
> > site name. I have been developing an programmatic administration tool
for
> > IIS 6.0 and I need the algorithm how IIS generates these identifiers. I
> have
> > been through MSDN and Google search but have nothing usable.
> >
> >
> >
> >
>
>



Re: IIS 6.0 Unique ID generation by Kristofer

Kristofer
Fri Nov 05 03:18:02 CST 2004

iisweb.vbs (in the code) uses IIsWebService.CreateNewSite to create new
websites on IIS 6.0.

Just for your interest :-)

--
Regards,
Kristofer Gafvert
http://www.ilopia.com


"Bernard" <qbernard@hotmail.com.discuss> wrote in message
news:eQrNV9uwEHA.1300@TK2MSFTNGP14.phx.gbl...
> I'm not a dev guy. but I don't think it needs the ID to create the
website.
> take a look at the built-in script.
>
> IISweb.vbs
>
> try iisweb /create
>
> it only ask you for the web root path, site description, ip, port, and
host
> header name.
>
> --
> Regards,
> Bernard Cheah
> http://www.tryiis.com/
> http://support.microsoft.com/
> http://www.msmvps.com/bernard/
>
>
>
> "Sýfýrýnc?Murat" <@> wrote in message
> news:eDLaotmwEHA.1512@TK2MSFTNGP12.phx.gbl...
> > I am hosting multiple web sites on a w2k3 server and want to create web
> > sites through an application to reduce the time spent for web site
> creation.
> > In order to create new web sites I need to assign an empty ID for
> > System.DirectoryServices class, so that it can create a new web site
with
> > that ID. I could easily enumerate used IDs and generate one that is not
in
> > use and create the new site with that ID but I know MMC uses an
algorithm
> to
> > generate IDs with respect to the ServerComment property (or website
name)
> > and I want my aplication to use the same procedure for the sake of
> > compatibility. This is the reason.
> >
> >
> > "David Wang [Msft]" <someone@online.microsoft.com> wrote in message
> > news:enYZDkmwEHA.1396@tk2msftngp13.phx.gbl...
> > > Using the administration APIs you can easily enumerate available
> websites,
> > > locate ones matching your criteria, and retrieve its ID.
> > >
> > > Can you please give the reason(s) why you need to be able to predict
the
> > > Website ID before creating the website? Are you also aware that you
can
> > > actually specify the ID for a website (you get an exception if the ID
is
> > > already used)?
> > >
> > > Anyways, I cannot think of a reason why anyone needs to know the
> > algorithm,
> > > including Microsoft...
> > >
> > > --
> > > //David
> > > IIS
> > > This posting is provided "AS IS" with no warranties, and confers no
> > rights.
> > > //
> > > "Sýfýrýnc?Murat" <@> wrote in message
> > > news:OkEMKMlwEHA.1512@TK2MSFTNGP12.phx.gbl...
> > > Hi,
> > >
> > > As everybody knows, IIS 6.0 assigns unique IDs based on the specified
> web
> > > site name. I have been developing an programmatic administration tool
> for
> > > IIS 6.0 and I need the algorithm how IIS generates these identifiers.
I
> > have
> > > been through MSDN and Google search but have nothing usable.
> > >
> > >
> > >
> > >
> >
> >
>
>



Re: IIS 6.0 Unique ID generation by Bernard

Bernard
Fri Nov 05 04:02:38 CST 2004

Cheers! was lazy to open the code :)

--
Regards,
Bernard Cheah
http://www.tryiis.com/
http://support.microsoft.com/
http://www.msmvps.com/bernard/



"Kristofer Gafvert" <kgafvert@NEWSilopia.com> wrote in message
news:enDVahxwEHA.1512@TK2MSFTNGP12.phx.gbl...
> iisweb.vbs (in the code) uses IIsWebService.CreateNewSite to create new
> websites on IIS 6.0.
>
> Just for your interest :-)
>
> --
> Regards,
> Kristofer Gafvert
> http://www.ilopia.com
>
>
> "Bernard" <qbernard@hotmail.com.discuss> wrote in message
> news:eQrNV9uwEHA.1300@TK2MSFTNGP14.phx.gbl...
> > I'm not a dev guy. but I don't think it needs the ID to create the
> website.
> > take a look at the built-in script.
> >
> > IISweb.vbs
> >
> > try iisweb /create
> >
> > it only ask you for the web root path, site description, ip, port, and
> host
> > header name.
> >
> > --
> > Regards,
> > Bernard Cheah
> > http://www.tryiis.com/
> > http://support.microsoft.com/
> > http://www.msmvps.com/bernard/
> >
> >
> >
> > "Sýfýrýnc?Murat" <@> wrote in message
> > news:eDLaotmwEHA.1512@TK2MSFTNGP12.phx.gbl...
> > > I am hosting multiple web sites on a w2k3 server and want to create
web
> > > sites through an application to reduce the time spent for web site
> > creation.
> > > In order to create new web sites I need to assign an empty ID for
> > > System.DirectoryServices class, so that it can create a new web site
> with
> > > that ID. I could easily enumerate used IDs and generate one that is
not
> in
> > > use and create the new site with that ID but I know MMC uses an
> algorithm
> > to
> > > generate IDs with respect to the ServerComment property (or website
> name)
> > > and I want my aplication to use the same procedure for the sake of
> > > compatibility. This is the reason.
> > >
> > >
> > > "David Wang [Msft]" <someone@online.microsoft.com> wrote in message
> > > news:enYZDkmwEHA.1396@tk2msftngp13.phx.gbl...
> > > > Using the administration APIs you can easily enumerate available
> > websites,
> > > > locate ones matching your criteria, and retrieve its ID.
> > > >
> > > > Can you please give the reason(s) why you need to be able to predict
> the
> > > > Website ID before creating the website? Are you also aware that you
> can
> > > > actually specify the ID for a website (you get an exception if the
ID
> is
> > > > already used)?
> > > >
> > > > Anyways, I cannot think of a reason why anyone needs to know the
> > > algorithm,
> > > > including Microsoft...
> > > >
> > > > --
> > > > //David
> > > > IIS
> > > > This posting is provided "AS IS" with no warranties, and confers no
> > > rights.
> > > > //
> > > > "Sýfýrýnc?Murat" <@> wrote in message
> > > > news:OkEMKMlwEHA.1512@TK2MSFTNGP12.phx.gbl...
> > > > Hi,
> > > >
> > > > As everybody knows, IIS 6.0 assigns unique IDs based on the
specified
> > web
> > > > site name. I have been developing an programmatic administration
tool
> > for
> > > > IIS 6.0 and I need the algorithm how IIS generates these
identifiers.
> I
> > > have
> > > > been through MSDN and Google search but have nothing usable.
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Re: IIS 6.0 Unique ID generation by Sıfırıncı

Sýfýrýncý
Fri Nov 05 04:16:43 CST 2004

Thanks.

iisweb.vbs uses WMI to add new web sites. Since I do not have any experience
with WMI and all WMI the examples uses either VBScript or JScript I am not
able to produce a solution this way.

System.DirectoryServices examples tell me that it is required to provide an
ID to create site.



"Bernard" <qbernard@hotmail.com.discuss> wrote in message
news:eQrNV9uwEHA.1300@TK2MSFTNGP14.phx.gbl...
> I'm not a dev guy. but I don't think it needs the ID to create the
website.
> take a look at the built-in script.
>
> IISweb.vbs
>
> try iisweb /create
>
> it only ask you for the web root path, site description, ip, port, and
host
> header name.
>
> --
> Regards,
> Bernard Cheah
> http://www.tryiis.com/
> http://support.microsoft.com/
> http://www.msmvps.com/bernard/
>
>
>
> "Sýfýrýnc?Murat" <@> wrote in message
> news:eDLaotmwEHA.1512@TK2MSFTNGP12.phx.gbl...
> > I am hosting multiple web sites on a w2k3 server and want to create web
> > sites through an application to reduce the time spent for web site
> creation.
> > In order to create new web sites I need to assign an empty ID for
> > System.DirectoryServices class, so that it can create a new web site
with
> > that ID. I could easily enumerate used IDs and generate one that is not
in
> > use and create the new site with that ID but I know MMC uses an
algorithm
> to
> > generate IDs with respect to the ServerComment property (or website
name)
> > and I want my aplication to use the same procedure for the sake of
> > compatibility. This is the reason.
> >
> >
> > "David Wang [Msft]" <someone@online.microsoft.com> wrote in message
> > news:enYZDkmwEHA.1396@tk2msftngp13.phx.gbl...
> > > Using the administration APIs you can easily enumerate available
> websites,
> > > locate ones matching your criteria, and retrieve its ID.
> > >
> > > Can you please give the reason(s) why you need to be able to predict
the
> > > Website ID before creating the website? Are you also aware that you
can
> > > actually specify the ID for a website (you get an exception if the ID
is
> > > already used)?
> > >
> > > Anyways, I cannot think of a reason why anyone needs to know the
> > algorithm,
> > > including Microsoft...
> > >
> > > --
> > > //David
> > > IIS
> > > This posting is provided "AS IS" with no warranties, and confers no
> > rights.
> > > //
> > > "Sýfýrýnc?Murat" <@> wrote in message
> > > news:OkEMKMlwEHA.1512@TK2MSFTNGP12.phx.gbl...
> > > Hi,
> > >
> > > As everybody knows, IIS 6.0 assigns unique IDs based on the specified
> web
> > > site name. I have been developing an programmatic administration tool
> for
> > > IIS 6.0 and I need the algorithm how IIS generates these identifiers.
I
> > have
> > > been through MSDN and Google search but have nothing usable.
> > >
> > >
> > >
> > >
> >
> >
>
>



Re: IIS 6.0 Unique ID generation by Sıfırıncı

Sýfýrýncý
Fri Nov 05 04:20:31 CST 2004

Thanks. It seems I will need to study on ADSI and WMI. I have been focused
on System.DirectoryServices but have not found the solution there.

Documentation on these matters is either quite poor or I do not know where
to look...


"Kristofer Gafvert" <kgafvert@NEWSilopia.com> wrote in message
news:uc6FvgxwEHA.2836@TK2MSFTNGP11.phx.gbl...
> Hello,
>
> You can use IIsWebService.CreateNewSite to create new sites. This is new
for
> IIS 6.0.
>
> I think the SDK is a bit vague on this, because the examples you can find
> that creates new websites does not use this.
>
> ADSI:
>
http://msdn.microsoft.com/library/en-us/iissdk/iis/iiswebservice_createnewsite.asp
>
> WMI:
>
http://msdn.microsoft.com/library/en-us/iissdk/iis/ref_mof_iiswebservice_createnewsite.asp
>
> Hope this answers your question.
>
> --
> Regards,
> Kristofer Gafvert
> http://www.ilopia.com
>
>
> "Sýfýrýncý Murat" <@> wrote in message
> news:eDLaotmwEHA.1512@TK2MSFTNGP12.phx.gbl...
> > I am hosting multiple web sites on a w2k3 server and want to create web
> > sites through an application to reduce the time spent for web site
> creation.
> > In order to create new web sites I need to assign an empty ID for
> > System.DirectoryServices class, so that it can create a new web site
with
> > that ID. I could easily enumerate used IDs and generate one that is not
in
> > use and create the new site with that ID but I know MMC uses an
algorithm
> to
> > generate IDs with respect to the ServerComment property (or website
name)
> > and I want my aplication to use the same procedure for the sake of
> > compatibility. This is the reason.
> >
> >
> > "David Wang [Msft]" <someone@online.microsoft.com> wrote in message
> > news:enYZDkmwEHA.1396@tk2msftngp13.phx.gbl...
> > > Using the administration APIs you can easily enumerate available
> websites,
> > > locate ones matching your criteria, and retrieve its ID.
> > >
> > > Can you please give the reason(s) why you need to be able to predict
the
> > > Website ID before creating the website? Are you also aware that you
can
> > > actually specify the ID for a website (you get an exception if the ID
is
> > > already used)?
> > >
> > > Anyways, I cannot think of a reason why anyone needs to know the
> > algorithm,
> > > including Microsoft...
> > >
> > > --
> > > //David
> > > IIS
> > > This posting is provided "AS IS" with no warranties, and confers no
> > rights.
> > > //
> > > "Sýfýrýncý Murat" <@> wrote in message
> > > news:OkEMKMlwEHA.1512@TK2MSFTNGP12.phx.gbl...
> > > Hi,
> > >
> > > As everybody knows, IIS 6.0 assigns unique IDs based on the specified
> web
> > > site name. I have been developing an programmatic administration tool
> for
> > > IIS 6.0 and I need the algorithm how IIS generates these identifiers.
I
> > have
> > > been through MSDN and Google search but have nothing usable.
> > >
> > >
> > >
> > >
> >
> >
>
>



Re: IIS 6.0 Unique ID generation by Kristofer

Kristofer
Fri Nov 05 05:09:48 CST 2004

Hello,

I wrote some quick code that creates a new website using CreateNewSite in C#
that my be of interest. You can find it here:

http://www.ilopia.com/html/createsite-cs.txt

(wrapping prevents me from posting here, it is so difficult to read code if
it wraps wrong).

Hope this helps you in your coding! Good lu