Re: IIS 6.0 Unique ID generation

From: Kristofer Gafvert (kgafvert_at_NEWSilopia.com)
Date: 11/05/04


Date: Fri, 5 Nov 2004 12:09:48 +0100

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 luck!

-- 
Regards,
Kristofer Gafvert
http://www.ilopia.com
"Sıfırıncı Murat" <@> wrote in message
news:egER3FywEHA.2016@TK2MSFTNGP15.phx.gbl...
> 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.
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>


Relevant Pages

  • Re: IIS 6.0 Unique ID generation
    ... "Kristofer Gafvert" wrote in message ... > websites on IIS 6.0. ... >> Bernard Cheah ... so that it can create a new web site ...
    (microsoft.public.inetserver.iis)
  • Re: publishing multiple websites in ISA 2004
    ... About your comment of not hosting websites on the SBS box, ... hosted off of a second server that is a member server in the network. ... We can publish multiple internal websites through ISA ... You may refer to the following KB article to build your own web site: ...
    (microsoft.public.windows.server.sbs)
  • Re: IIS 6 testing
    ... Virtual Directories don't support host headers, only websites do, so the you ... I do not do technical support via email. ... >> If you have the web site pointing to a folder on your C: ...
    (microsoft.public.inetserver.iis.security)
  • Re: Walthers Swing Bridge up-date
    ... I will investigate charter's web site stuff. ... > Users of my websites there don't have do provide any information. ... >> Pictures of my Railroad are at www.flickr.com. ...
    (rec.models.railroad)
  • Re: Issues with multiple website development on Windows 2000 pro box
    ... These are separate websites and expect to be at the root. ... I'll try stopping the iisadmin and restarting it. ... problem is occuring on windows XP pro as well. ... > Can;t you have all the projects running under the same IIS web site? ...
    (microsoft.public.dotnet.framework.aspnet)