Users/Groups
Delete Disabled Users
Delete Disabled Users
Enum. Users
Enum. Users
Delete Users
Add Users
Enum. Groups
Enum. Groups
Change Groups
Add Group
Active Directory
Enum. AD Groups
Enum. AD Users
List AD Users w/Prop
Join AD Users
NIC/IP Addresses
Get IP Addresses
Get IP Addresses
Backup and Restore IP's
Add IP's
NIC Settings
OS/Hardware
OS Info Script
OS Info Script All
OS Info Script All
OS System Count
Hardware Info Script
Hardware Info Script #1
Hardware Info Script #2
CPU Settings
Enum. Printers
Disk Quotas
Disable Disk Quota
Enable Disk Quota
Disk Quota Query
Disk Quota Update
Shares/Files/Sessions
Enum. Shares
Enum. Shares
Enum. All Shares
Enum. Open Files
Enum. Open Files
Enum. Open Sessions
Others
Servers Uptime
DNS Stuff
Services Enum
Services Enum
Enum Processes
Enum Hot Fixes
MS FTP Server
FTP VD Query
FTP VD Delete
FTP Site Enum.
MS WWW Server
WWW Site Enum.
Enum Mime Types
Enum Mime Types
Application Pools
Application Pool Enum
Application Pool Enum
Create Application Pool
Create Application Pool
Delete Application Pool
Enum Apps in App Pool
Enum App Pool Settings
Move Apps Between App Pools
Others
IIS Component Probe
IIS Status
Enum SQL Dbases
Backup SQL Dbases
Orphan SQL Users
List AD/WG
My AD/WG Name
My PC Name
Enum AD Computers
Contact Us Form
SM Login Form Code
Imail Login Form Code
Enum. Domains in Imail
Enum. Users in Imail
CDONTS Component
CDOSYS Component
SA SMTP Component
App Pool Monitor
Ping and Tracert
Hard Drive Monitoring
Uptime Monitoring
Desktop Lock
CD Key Revealer
MIK Restarter
Site Map
About the Site
RSS Feeds I Read
Custom Scripts
Visitor #:
windowsadminscripts.com
www
Script:
Enumerate Mime Types
This script will enumerate all Mime Types on a computer. You can also search for Mime types by Content Type.
Script Usage:
List All Mime Types:
cscript enumMimes.vbs /computer:[computername] /list
Search for a Mime Content Type:
cscript enumMimes.vbs /computer:[computername] /search:[search text]
Email Address To Send Sample Code To:
@
'**************************************************** ' Script Witten by Larry Heintz ' April 2006 www.windowsadminscripts.com ' This script will enumerate all Mime Types on a ' computer. You can also search for Mime types by ' Content Type. ' ' Script Usage: ' List All Mime Types: ' cscript enumMimes.vbs /computer:[computername] /list ' Search for a Mime Content Type: ' cscript enumMimes.vbs /computer:[computername] /search:[search text] '**************************************************** Dim args,computername,list,search Set args = Wscript.Arguments.Named computername = args.Item("computer") list = args.Item("list") search = args.Item("search") if computername = "" then computername = getComputer() else computername = computername end if if wscript.arguments.count = 0 then wscript.echo "Script Usage:" wscript.echo "List All Mime Types:" wscript.echo " cscript enumMimes.vbs /computer:[computername] /list" wscript.echo "Search for a Mime Content Type:" wscript.echo " cscript enumMimes.vbs /computer:[computername] /search:[search text]" wscript.quit elseif args.exists("list") then Call enumMimes(computername) elseif args.exists("search") then if search = "" then wscript.echo "The script has ended due to no Search Text given" wscript.quit else search = trim(lcase(search)) end if Call searchMimes(computername,search) else wscript.echo "Script Usage:" wscript.echo "List All Mime Types:" wscript.echo " cscript enumMimes.vbs /computer:[computername] /list" wscript.echo "Search for a Mime Content Type:" wscript.echo " cscript enumMimes.vbs /computer:[computername] /search:[search text]" wscript.quit end if Function enumMimes(computer) On Error Resume Next Dim objMime,MimeMapping,count count = 0 Set objMime = GetObject("IIS://" & computer & "/MimeMap") if not (errorChecking (computer)) then wscript.echo "Registered File Types on " & ucase(computer) wscript.echo "====================================" & VbCrLF For Each MimeMapping in objMime.MimeMap count = count + 1 wscript.echo "Extension: " & MimeMapping.Extension & " Content Type: " & MimeMapping.MimeType Next if count <> 0 then wscript.echo VbCrLF & "There are " & count & " different Mime Types on " & ucase(computer) else wscript.echo "I am sorry there no Mime Types on " & ucase(computer) end if end if Set objMime = nothing End Function Function searchMimes(computer,ctype) On Error Resume Next Dim objMime,MimeMapping,temp,count count = 0 Set objMime = GetObject("IIS://" & computer & "/MimeMap") if not (errorChecking (computer)) then wscript.echo ctype & " Mime Content Type on " & ucase(computer) wscript.echo "============================================" & VbCrLF For Each MimeMapping in objMime.MimeMap temp = split(MimeMapping.MimeType,"/") if instr(temp(0),ctype) <> 0 then count = count + 1 wscript.echo "Extension: " & MimeMapping.Extension & " Content Type: " & MimeMapping.MimeType end if Next if count <> 0 then wscript.echo VbCrLF & "There are " & count & " different Mime Extensions matching the Content Type you have searched for" else wscript.echo "I am sorry there no Mime Extensions matching the Content Type you have searched for" end if end if Set objMime = nothing End Function Function getComputer() Dim objNet Set objNet = WScript.CreateObject("WScript.Network") getComputer = objNet.ComputerName Set objNet = Nothing End Function Function errorChecking(computername) errorChecking = False if err.number <> 0 then wscript.echo "Unable to connect to " & ucase(computername) err.Clear () errorChecking = True wscript.quit end if end Function
Click HERE to download this script.
Copyright 2006 WindowsAdminScripts.com all rights reserved.