naexpert
asked on
Script available to add MIME type and Documents?
Hi Experts,
Is there a way to add MIME Types and Documents to IIS6.0 without using Internet Information Services Manager (IISM)? Im thinking there may be a script available or command line systax that I'm not aware of?
IIS 6.0 Windows 2003 SP1
Virtual Directory | Properties | Documents | Enable / Add default page
Virtual Directory | Properties | HTTP Headers | MIME Types | New
Thanks you for your advice,
Cheers, naexpert
Is there a way to add MIME Types and Documents to IIS6.0 without using Internet Information Services Manager (IISM)? Im thinking there may be a script available or command line systax that I'm not aware of?
IIS 6.0 Windows 2003 SP1
Virtual Directory | Properties | Documents | Enable / Add default page
Virtual Directory | Properties | HTTP Headers | MIME Types | New
Thanks you for your advice,
Cheers, naexpert
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi meverest,
I tried your script and it works for MIME types, brilliant, part of my original question was also about how to add documents?
Virtual Directory | Properties | Documents | Enable / Add default page
If you can provide me with this info, then you've cracked it!
Cheers, naexpert.
I tried your script and it works for MIME types, brilliant, part of my original question was also about how to add documents?
Virtual Directory | Properties | Documents | Enable / Add default page
If you can provide me with this info, then you've cracked it!
Cheers, naexpert.
ASKER
I eventually found the syntax to add documents...
Adsutil.vbs set w3svc/defaultdoc "default.htm,default.html, default.as p,default. aspx,index .htm,index .html,inde x.
asp,index.aspx,temp.htm"
Thanks for your help.
Adsutil.vbs set w3svc/defaultdoc "default.htm,default.html,
asp,index.aspx,temp.htm"
Thanks for your help.
Hi,
you do it the same way for documents.
use the 'enum' command demonstrated above to see what the existing context objects are, then use 'set' to change them.
e.g:
C:\Inetpub\AdminScripts>cs cript adsutil.vbs enum W3SVC/1/Root/
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
KeyType : (STRING) "IIsWebVirtualDir"
AppRoot : (STRING) "/LM/W3SVC/1/Root"
.. etc ..
HttpExpires : (STRING) "D, 0"
DefaultDoc : (STRING) "Default.aspx,Default.htm, Default.as p,index.ht m,iisstart .htm"
Path : (STRING) "C:\Inetpub\wwwroot\"
.. etc ..
MimeMap : (MimeMapList) ".special,some/special" ".special2,some/special2"
DirBrowseFlags : (INTEGER) 3221225534
EnableDirBrowsing : (BOOLEAN) True
DirBrowseShowDate : (BOOLEAN) True
DirBrowseShowTime : (BOOLEAN) True
DirBrowseShowSize : (BOOLEAN) True
DirBrowseShowExtension : (BOOLEAN) True
DirBrowseShowLongDate : (BOOLEAN) True
EnableDefaultDoc : (BOOLEAN) True
AuthFlags : (INTEGER) 7
.. etc ..
EnableDirBrowsing : (BOOLEAN) True
DirBrowseShowDate : (BOOLEAN) True
DirBrowseShowTime : (BOOLEAN) True
[/W3SVC/1/Root/aspnet_clie nt]
[/W3SVC/1/Root/cgi-bin]
[/W3SVC/1/Root/WWW]
see in the list these two lines:
DefaultDoc : (STRING) "Default.aspx,Default.htm, Default.as p,index.ht m,iisstart .htm"
and:
EnableDefaultDoc : (BOOLEAN) True
This tells us that the DefaultDoc key is a comma delimited list of document names, and the enable default doc is a boolean.
so to set the DefaultDoc, we do:
adsutil.vbs enum W3SVC/1/Root/DefaultDoc "mydoc.html,Default.aspx,D efault.htm ,Default.a sp,index.h tm"
and to enable:
adsutil.vbs enum W3SVC/1/Root/EnableDefault Doc True
cheers!
you do it the same way for documents.
use the 'enum' command demonstrated above to see what the existing context objects are, then use 'set' to change them.
e.g:
C:\Inetpub\AdminScripts>cs
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
KeyType : (STRING) "IIsWebVirtualDir"
AppRoot : (STRING) "/LM/W3SVC/1/Root"
.. etc ..
HttpExpires : (STRING) "D, 0"
DefaultDoc : (STRING) "Default.aspx,Default.htm,
Path : (STRING) "C:\Inetpub\wwwroot\"
.. etc ..
MimeMap : (MimeMapList) ".special,some/special" ".special2,some/special2"
DirBrowseFlags : (INTEGER) 3221225534
EnableDirBrowsing : (BOOLEAN) True
DirBrowseShowDate : (BOOLEAN) True
DirBrowseShowTime : (BOOLEAN) True
DirBrowseShowSize : (BOOLEAN) True
DirBrowseShowExtension : (BOOLEAN) True
DirBrowseShowLongDate : (BOOLEAN) True
EnableDefaultDoc : (BOOLEAN) True
AuthFlags : (INTEGER) 7
.. etc ..
EnableDirBrowsing : (BOOLEAN) True
DirBrowseShowDate : (BOOLEAN) True
DirBrowseShowTime : (BOOLEAN) True
[/W3SVC/1/Root/aspnet_clie
[/W3SVC/1/Root/cgi-bin]
[/W3SVC/1/Root/WWW]
see in the list these two lines:
DefaultDoc : (STRING) "Default.aspx,Default.htm,
and:
EnableDefaultDoc : (BOOLEAN) True
This tells us that the DefaultDoc key is a comma delimited list of document names, and the enable default doc is a boolean.
so to set the DefaultDoc, we do:
adsutil.vbs enum W3SVC/1/Root/DefaultDoc "mydoc.html,Default.aspx,D
and to enable:
adsutil.vbs enum W3SVC/1/Root/EnableDefault
cheers!
hey, you beat me to it! ;-)
I actually expected that you would work it out sooner or later - apparently 'sooner' ;-)
Cheers!
I actually expected that you would work it out sooner or later - apparently 'sooner' ;-)
Cheers!
ASKER
Thank you for your brilliant help, excellent!
Cheers, naexpert.
Cheers, naexpert.
ASKER
I'll try this and give you feedback asap.
Thanks for your input.
Cheers, naexpert.