ADM 331 Administrative Scripting for IIS 6.0 Using WMI Alexis Eller Program Manager Internet Information Services (IIS)

Slides:



Advertisements
Similar presentations
Faith Allington Program Manager Microsoft Corporation WSV322.
Advertisements

Module 5: Creating and Configuring Group Policy
DEV392: Extending SharePoint Products And Technologies Through Web Parts And ASP.NET Clint Covington, Program Manager Data And Developer Services - Office.
Windows Server “Longhorn” RDP Airlift. Managing AD with PowerShell; Creating custom administrative consoles Dmitry Sotnikov CTO, Windows Management Quest.
Building Enterprise Applications Using Visual Studio ®.NET Enterprise Architect.
Next Generation Web Vitalis Konopelec Technology Solution Professional Microsoft Slovakia s.r.o.
Lesson 20 – OTHER WINDOWS 2000 SERVER SERVICES. DHCP server DNS RAS and RRAS Internet Information Server Cluster services Windows terminal services OVERVIEW.
Daniel Petri MVP, Microsoft Infrastructure Manager John Bryce Training November 2007.
IIS 7: The Next Generation Web Application Server Platform Michael Volodarsky Program Manager Web Platform and Tools Team Microsoft Corporation.
Winter Consolidated Server Deployment Guide for Hosted Messaging and Collaboration version 3.5 Philippe Maurent Principal Consultant Microsoft.
Enterprise Reporting with Reporting Services SQL Server 2005 Donald Farmer Group Program Manager Microsoft Corporation.
Walter Pitrof Technology Solution Professional Microsoft Switzerland Backup, Restore und Disaster Recovery mit Data Protection Manager 2012 Philipp Witschi.
Saad Ladki Program Manager Microsoft Corporation WUX403.
IIS, Tools And Extensibility Madhur Joshi Development Lead Phone:
Understanding Group Policy on Windows Server 2003 John Howard, IT Pro Evangelist, Microsoft UK
Windows ® Powered NAS. Agenda Windows Powered NAS Windows Powered NAS Key Technologies in Windows Powered NAS Key Technologies in Windows Powered NAS.
WEB329 ASP.NET: A Lap Around the New Enhancements for Web Developers in Microsoft Visual Studio 2005 Omar Khan Lead Program Manager Web Platform and Tools.
Windows Vista: Volume Activation 2.0
OFC302 Building Smart Document Solutions in Word & Excel Martin Sawicki Lead Program Manager.
AppCMD Quick Reference Guide for IIS 7 installed on Win2k8 Servers.
DEV317 Integrating Extensible Business Graphics into Enterprise Applications using Visio 2003 Mai-lan Tomsen Bukovec Program Manager.
Created by the Community for the Community BizTalk & Build.
Using the WDK for Windows Logo and Signature Testing Craig Rowland Program Manager Windows Driver Kits Microsoft Corporation.
OFC304 Excel 2003 Overview: XML Support Joseph Chirilov Program Manager.
OFC 200 Microsoft Solution Accelerator for Intranets Scott Fynn Microsoft Consulting Services National Practices.
ADM421 Scripting Group Policy Operations BJ Whalen Program Manager Windows Server Microsoft Corporation.
Copyright 2000 eMation SECURITY - Controlling Data Access with
Introducing Reporting Services for SQL Server 2005.
 2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 21 - Web Servers (IIS, PWS and Apache) Outline 21.1 Introduction 21.2 HTTP Request Types 21.3.
The In’s and Out’s of the IIS 6.0 Migration Tool The In’s and Out’s of the IIS 6.0 Migration Tool Chris Adams Web Platform Supportability Lead Microsoft.
Slide 2 The Microsoft Office Project 2003 Software Development Kit Jim Corbin Programmer Writer Office Developer Documentation Microsoft Corporation Uma.
DEV325 Deploying Visual Studio.NET Applications Billy Hollis Author / Consultant.
OFC290 Information Rights Management in Microsoft Office 2003 Lauren Antonoff Group Program Manager.
DEV339 Best Practices for Debugging Visual Studio.NET Applications Keith Pleas Architect, Guided Design
Slide 1.NET Development for Project 2003 Samples from the Project 2003 SDK Jim Corbin Programmer Writer Office Developer Documentation Microsoft Corporation.
Paul Butterworth Management Technology Architect
Tips and Tricks for Managing and Administering your Enterprise Project Management Server Solution Mike Joe / Karthik Chermakani Software Test Engineer.
DEV303 ASP.NET: Leveraging Visual Studio.NET For Web Projects Tony Goodhew Product Manager Microsoft Corp.
Module 5: Creating and Configuring Group Policies.
DAT 332 SQL Server 2000 Data Transformation Services (DTS) Best Practices Euan Garden Product Unit Manager SQL Server Development Microsoft Corporation.
Solutions using Microsoft Content Management Server 2002 Connector for SharePoint Technologies Sue Corke Mark Harrison Microsoft UK.
LegendCorp What is System Center Virtual Machine Manager (SCVMM)? SCVMM at a glance Features and Benefits Components / Topology /
DEP331 Migrating to Windows XP Mike Coleman Lead Product Manager, Windows XP Microsoft Corporation.
Simplify IT Management with AD Scripting Chalermrath K. (MCSE: Security) Jirat B. (MCSE, RHCE) Technology Specialists Microsoft Thailand.
Everything You Want To Know About Script But Were Afraid To Ask… Mark Carroll Drew Lytle Script Technologies Microsoft Corporation.
MSG331 Exchange Server 2000/2003 Software Development Kit Susan Hill Lead Programmer Writer Microsoft Corporation.
Developing SQL Server 2000 Reporting Services Applications Brian Welcker Group Program Manager SQL Server Reporting Services Microsoft Corporation.
Hosting Websites and Web Applications with Microsoft ® SQL Server ® 2008.
Security Configuration Wizard Keith D Miller Microsoft European Support Readiness Manager.
Longhorn Search and Organize User And Developer Experience Paul Cutsinger – Lead Program Manager Kerem Karatal – Lead Program Manager Microsoft Corporation.
Linux Operations and Administration
Microsoft Visual Studio 2005 Tools for the Office System: Building Office Solutions Using Visual Studio 2005 Tools for Office Andrew Coates Developer Evangelist.
Configuring and Deploying Web Applications Lesson 7.
DEV332 Programming for the Middle Tier in Visual Basic.NET Billy Hollis Author / Consultant.
MSG 334 Creating Exchange Administrative Scripting for the Non-Programmer Susan Hill Lead Programmer Writer Microsoft Corporation.
The 2007 Microsoft Office System Servers Enterprise Content Management, Workflow and Forms Martin Parry Developer and Platform Group, Microsoft Ltd
Windows Server 2003 SP1 Technical Overview John Howard, IT Pro Evangelist, Microsoft UK
Tips and Tricks for Debugging ASP.NET Web Applications and Services Habib Heydarian TLNL05 Program Manager Microsoft Corporation.
Developing Custom ASP.NET Providers For Membership And Role Manager Stefan Schackow PRS404 Program Manager – Web Platform and Tools Microsoft Corporation.
ASP.NET 2.0 Mohammed Abdelhadi Developer.NET Evangelist Microsoft Corporation.
Building Enterprise Applications Using Visual Studio®
Introducing SQL Server 2000 Reporting Services
Extended Operating System Support
Introduction to ASP.NET 2.0
Visual Studio Tools for Office 2005
Azure API Management Jothi Prakash A
Microsoft Ignite NZ October 2016 SKYCITY, Auckland.
Windows Forms in Visual Studio 2005: An in-depth look at key features
Introduction to ASP.NET Parts 1 & 2
Windows Forms in Visual Studio 2005: An Overview
Presentation transcript:

ADM 331 Administrative Scripting for IIS 6.0 Using WMI Alexis Eller Program Manager Internet Information Services (IIS)

Agenda Overview of the Windows Script Host Manageability improvements in IIS 6.0 Overview of Windows Management Instrumentation IIS 6.0 WMI Provider Practical examples Special notes regarding JScript & WMI

Overview of the Windows Script Host Automation Provisioning Custom tools Rich object model Access to automation COM objects

Manageability Improvements in IIS 6.0 Metabase stored in XML Editable while the server is running Automatic versioning and history Password protected backups Import & Export Command line administration Remote administration IIS WMI Provider

The XML Metabase demo demo

Command line Administration for IIS 6.0 Use the IIS WMI provider Supplied VBScript scripts manage Common web and FTP tasks Use from command line, batch jobs Serve as IIS WMI scripting examples ADSI provider still supported Create scripts using the IIS providers

Playing with the command line scripts demo demo

In the System32 Directory Web: iisweb.vbs, iisvdir.vbs FTP: iisftp.vbs, iisftpdr.vbs Metabase backup/restore: iisback.vbs Import/export: iiscnfg.vbs Application extensions, dependencies, files: iisext.vbs Mapping between worker process and application pool: iisapp.vbs

WMI Overview Introduced in Windows 2000 Uses the object oriented model Universal way to access machine information Consistent, unified view of managed objects Supports SQL-like queries (WQL)

Using CIM Studio (from WMI Tools) demo demo

IIS 6.0 WMI Provider Extends WMI schema to include IIS classes Represents the IIS metabase Equivalent ADSI classes and more… Class/Instance provider Method provider IIS Namespace: root\MicrosoftIISv2

IIS 6.0 WMI Provider Each IIS object available through WMI IIsWebServer, IIsFtpServer, etc. Similar to ADSI IIS classes Separates read-only from read-write properties IIsWebServer vs. IIsWebServerSetting Association classes represent relationships

IIS 6.0 WMI Provider New classes to represent structured data ServerBinding, SecureBinding ScriptMap, MimeMap ApplicationDependency, WebSvcExtRestrictionList HttpError, HttpCustomHeader, CustomErrorDescription

Browsing through IIS WMI Classes using CIM Studio: classes, instances and properties demo demo

How the command line scripts work: going inside iisweb.vbs demo demo

Going Deeper Monitoring Using notification queries Security Audit Look for properties set with suspicious values Bulk operations Multiple operations

Monitoring: keeping an eye on that application pool demo demo

Security: Looking for sites with WRITE access enabled demo demo

Friendly name to site ID translation demo demo

Bulk changes: Disabling a web service extension on multiple machines demo demo

Working across WMI namespaces demo demo

Scripting WMI Using JScript Method Output Parameters VBScript: Methods can be called directly JScript: Methods are called with the SWbemMethod, InParam and OutParam objects. SWbemMethod WMI Arrays VBScript: handle as usual JScript: use the toArray() function to convert the WMI safearray to an array recognized by the JScript engine

Methods with OutParameters vdirPath = WScript.Arguments( 0 ) Set win32svc = GetObject( "winmgmts:/root/CIMv2" ) Set iissvc = GetObject( "winmgmts:/root/MicrosoftIISv2" ) Set vdir = iissvc.Get( "IIsWebVirtualDirSetting='" & vdirPath & "'" ) Set obj = win32svc.Get( "Win32_LogicalFileSecuritySetting='" & vdir.Path & "'" ) result = obj.GetSecurityDescriptor( sd ) WScript.Echo "Result: " & result WScript.Echo sd.GetObjectText_ var vdirPath = WScript.Arguments( 0 ); var win32svc = GetObject( "winmgmts:/root/CIMv2" ); var iissvc = GetObject( "winmgmts:/root/MicrosoftIISv2" ); var vdir = iissvc.Get( "IIsWebVirtualDirSetting='" + vdirPath + "'" ); var obj = win32svc.Get( "Win32_LogicalFileSecuritySetting='" + vdir.Path + "'" ); var result = obj.ExecMethod_("GetSecurityDescriptor"); WScript.Echo("Result: " + result.ReturnValue); WScript.Echo( result.Descriptor.GetObjectText_() ); VBScript – perm.vbs JScript – perm.js (includes a helper function for displaying object properties) Direct Call Call using ExecMethod_

Handling WMI Arrays in JScript set wmi = GetObject("winmgmts:/root/MicrosoftIISv2") set site = wmi.Get(“IIsWebServerSetting='w3svc/1'") for each binding in site.ServerBindings WScript.Echo "IP: " & binding.IP WScript.Echo "Port: " & binding.Port WScript.Echo "Hostname: " & binding.Hostname WScript.Echo next var wmi = GetObject( "winmgmts:/root/MicrosoftIISv2" ); var site = wmi.Get("IIsWebServerSetting='w3svc/1'"); var bindings = site.ServerBindings.toArray() ; for ( i = 0; i < bindings.length; i++ ) { WScript.Echo("IP: " + bindings[i].IP); WScript.Echo("Hostname: " + bindings[i].Hostname); WScript.Echo("Port: " + bindings[i].Port); } VBScript – enumerateBindings.vbs JScript – enumerateBindings.js

Call To Action Consider Scripting Leverage IIS WMI provider advantages Unified object model Querying capabilities Monitoring capabilities Review IIS 6.0 command line scripts Use them Learn from them

Ask The Experts Get Your Questions Answered I will be available in the “Ask The Experts” area after this presentation from 11:30 – 13:00

Community Resources IIS Community Portal nters/iis/ IIS Portal IIS Newsgroups Microsoft.public.inetserver.iis Microsoft.public.inetserver.iis.ftp Microsoft.public.inetserver.iis.security Third-party sites:

Suggested Reading & Resources Using WMI to Manage IIS us/iisref/htm/prog_wmi_using.asp us/iisref/htm/prog_wmi_using.asp WMI Downloads – WMI Tools Writing WMI Scripts in JScript – describes how this is different from using VBScript /en-us/wmisdk/wmi/writing_wmi_scripts_in_jscript.asp /en-us/wmisdk/wmi/writing_wmi_scripts_in_jscript.asp Enumerating WMI Namespaces (ie. What other WMI providers exist?) url=/technet/scriptcenter/scrguide/sas_wmi_khjg.asp url=/technet/scriptcenter/scrguide/sas_wmi_khjg.asp

Additional IIS Resources IIS 6.0 Deployment Guides: Medium to Large Organizations amilyid=f31a5fd5-03db-46d2-9f edd039eb9&displaylang=en amilyid=f31a5fd5-03db-46d2-9f edd039eb9&displaylang=en Small Organizations c-96e e036de6d/06NT4IIS.doc c-96e e036de6d/06NT4IIS.doc IIS 6.0 Resource Kit Tools x?FamilyID=56fc92ee-a71a-4c73-b628- ade629c89499&DisplayLang=en x?FamilyID=56fc92ee-a71a-4c73-b628- ade629c89499&DisplayLang=en

evaluations evaluations

© 2003 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY.