Feb 23, 2007

[dotNet] Windows PowerShell にチャレンジ (5)

一通り基本的なところを眺め終わったので、スクリプトのサンプルを見てみることに。 Microsoft のサイトに Windows PowerShell のサンプルスクリプト用リポジトリが用意されている。 結構充実していて勉強にはもってこいな感じ。

Scripting with Windows PowerShell
http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx
The Script Center Script Repository: Sample Windows PowerShell Scripts
http://www.microsoft.com/technet/scriptcenter/scripts/msh/default.mspx

提供されているサンプルスクリプト

  • Active Directory - Sample scripts for managing Active Directory and Active Directory objects.
    • Domains - Sample scripts for managing Active Directory domains.
      • List Domain Information
  • Applications - Sample scripts for managing software and applications on servers and client computers.
    • Client Applications - Sample scripts for managing software on user computers, including scripts for installing, updating, and deleting software installed using Windows Installer.
      • List Information About the Binary Files Used by an Application
      • List Installed Software
      • List Installed Software Features
      • List the Codec Files on a Computer
  • Desktop Management - Sample scripts for managing such things as desktop settings, computer startup and shutdown, and System Restore.
    • Logon Sessions - Sample scripts for retrieving information about computer logon sessions, including identifying the user logged on to a remote computer.
      • List Logon Session Information
    • Startup and Shutdown - Sample scripts for managing Windows startup settings and for shutting down computers.
      • List Computer Startup Commands
      • List Recovery Configuration Options
      • List the Boot Configuration Properties of a Computer
    • Windows Activation - Sample scripts for managing Windows Activation, including scripts for activating Windows both online and offline.
      • List Windows Product Activation Status
    • Windows and Windows Explorer Settings - Sample scripts for configuring Windows and Windows Explorer settings.
      • List Desktop Settings
      • List Environment Variables on a Computer
      • List Shortcuts on a Computer
      • List Start Menu Groups
      • List Start Menu Items
      • List Start Menu Program Groups
  • Hardware - Sample scripts for managing and monitoring computer hardware.
    • Basic Hardware and Firmware - Sample scripts for retrieving information about the hardware and firmware installed on a computer.
      • List Basic Computer Information
      • List Computer Baseboard Properties
      • List Computer Bus Properties
      • List Computer Chassis Information
      • List Computer Fan Information
      • List Infrared Device Information
      • List IRQ Settings
      • List Motherboard Device Information
      • List Onboard Devices
      • List Processor Information
    • Batteries and Power Supplies - Sample scripts for retrieving information about batteries and power supplies installed in a computer.
      • List Battery Information
      • List Portable Battery Information
      • List UPS Information
    • Memory - Sample scripts for retrieving information about the physical memory installed in a computer.
      • List Cache Memory Information
      • List Device Memory Addresses
      • List DMA Channel Information
      • List Memory Array Information
      • List Memory Devices
      • List Physical Memory Properties
      • List Physical Memory Array Properties
    • Peripherals and Devices - Sample scripts for retrieving information about peripherals and other devices installed on a computer.
      • List Keyboard Properties
      • List Modem Information
      • List Plug and Play Devices
      • List Plug and Play Signed Drivers
      • List Pointing Device Properties
      • List Sound Card Properties
    • Ports and Slots - Sample scripts for retrieving information about ports and system slots installed in a computer.
      • List 1394 Controller Settings
      • List Parallel Port Properties
      • List PCMCIA Controller Information
      • List Port Connector Properties
      • List Port Resource Information
      • List Serial Port Configuration Properties
      • List Serial Port Properties
      • List System Slot Properties
    • Video and Display - Sample scripts for retrieving information about video controllers, display cards, and monitors installed on a computer.
      • List Current Display Configuration Values
      • List Desktop Monitor Properties
      • List Display Controller Configuration Settings
      • List Video Controller Properties
  • Logs - Sample scripts for managing event logs and plain-text log files.
    • Event Logs - Sample scripts for managing event logs (for example, backing up and clearing event logs), and for retrieving events from event logs.
      • List Event Log Properties
      • List Events from the Event Logs
  • Networking - Sample scripts for managing and monitoring network configurations and network applications.
    • Client-Side Management - Sample scripts for configuring TCP/IP settings (IP address, DNS Server, WINS Server, etc.) on client computers.
      • Retrieving Network Configuration Information - Sample scripts for retrieving information about TCP/IP settings on client computers.
        • List IP4 Route Table Information
        • List Network Adapter Configuration Properties
        • List Network Adapter Properties
        • List Network Client Information
        • List Network Login Profiles
        • List Proxy Server Information
        • List the Network Protocols on a Computer
  • Operating System - Sample scripts for managing and monitoring the Windows operating system.
    • COM and DCOM - Sample scripts for retrieving information about COM and DCOM settings and classes found on a computer.
      • List Classic COM Class Settings
      • List Classic COM Classes
      • List Component Categories
      • List DCOM Application Settings
      • List DCOM Applications
      • List ProgIDs
    • Dates and Times - Sample scripts for retrieving date and time information (including local time and time zone information) from computers.
      • List the Local Time on a Computer
      • List Time Zone Information for a Computer
    • Page Files - Sample scripts for retrieving information from and configuring page files.
      • List Page File Properties
      • List Page File Settings
      • List Page File Use
    • Processes - Sample scripts for managing and monitoring the processes running on a computer.
      • Processes and Threads - Sample scripts for managing processes and threads, including scripts for creating new processes and terminating existing processes.
        • List Information about the Threads Active on a Computer
        • List the Processes Running on a Computer
    • Registry - Sample scripts from retrieving information from and writing information to the Windows registry.
      • List Registry Properties
    • Services - Sample scripts for managing Windows services and for listing and/or modifying the properties of those services.
      • List Service Load Order Groups
      • List Service Properties
    • Task Scheduling - Sample scripts for creating, modifying, and deleting scheduled jobs on a computer.
      • List Scheduled Tasks
    • Version Information - Sample scripts for retrieving information about the version of Windows installed on a computer.
      • List Operating System Properties
  • Other Directory Services - Sample scripts for managing directory services other than Active Directory.
    • Local Accounts and Windows NT 4.0 Accounts - Sample scripts for managing user and group accounts on local computers and in Windows NT 4.0 domains.
      • Groups - Sample scripts for managing security groups on local computers and/or in Windows NT 4.0 domains.
        • List Group Information
      • User Accounts - Sample scripts for managing user accounts on local computers and/or in Windows NT 4.0 domains.
        • List User Account Information
  • Printing - Sample scripts for managing printers, print jobs, print servers, and other parts of the Windows printing infrastructure.
    • Print Servers, Print Queues, and Print Jobs - Sample scripts for managing print servers, print queues, and individual print jobs.
      • List Print Job Information
      • List Printer Capabilities
      • List Printer Information
    • Printer Ports and Printer Drivers - Sample scripts for retrieving information about and for configuring printer ports and printer drivers on a computer.
      • List Printer Drivers
      • List Printer Port Properties
  • Scripting Techniques - Sample scripts demonstrating a wide variety of scripting tips, tricks, and techniques useful to script writers.
    • Dates and Times - Sample scripts for manipulating dates and times, particularly the UTC times used by WMI.
      • List the UTC Time on a Computer
    • WMI - Sample scripts for retrieving information about objects that can be used in WMI scripts.
      • List WMI Setting Information
  • Service Packs and Hot Fixes - Sample scripts for retrieving information about service packs and hot fixes installed on a computer.
    • List Installed Hot Fixes
  • Storage - Sample scripts for managing files, folders, file systems, and storage devices.
    • Disk Drives and Volumes
    • Disk Quotas
    • Folders
    • Shared Folders
  • Terminal Server - Sample scripts for managing Windows Terminal Server.
    • Retrieving Terminal Server Properties - Sample scripts for retrieving information about Terminal Server configuration settings.
      • List Terminal Service Service Properties
      • List Terminal Services Accounts
      • List Terminal Services Client Settings
      • List Terminal Services Environment Settings
      • List Terminal Services General Settings
      • List Terminal Services Logon Settings
      • List Terminal Services Network Adapter List Settings
      • List Terminal Services Network Adapter Settings
      • List Terminal Services Permission Settings
      • List Terminal Services Remote Control Settings
      • List Terminal Services Session Directory Settings
      • List Terminal Services Session Settings
      • List Terminal Services Terminal Settings
      • List Terminal Services Terminals