PacktLib: Windows Server 2012 Automation with PowerShell Cookbook

Windows Server 2012 Automation with PowerShell Cookbook


About the Author

About the Reviewers


Understanding PowerShell Scripting


Managing security on PowerShell scripts

Creating and using functions

Creating and using modules

Creating and using PowerShell profiles

Passing variables to functions

Validating parameters in functions

Piping data to functions

Recording sessions with transcripts

Signing PowerShell scripts

Sending e-mail

Sorting and filtering

Using formatting to export numbers

Using formatting to export data views

Using jobs

Dealing with errors in PowerShell

Tuning PowerShell scripts for performance

Creating and using Cmdlets

Managing Windows Network Services with PowerShell


Configuring static networking

Installing domain controllers

Configuring zones in DNS

Configuring DHCP scopes

Configuring DHCP server failover

Converting DHCP addresses to static

Building out a PKI environment

Creating AD users

Searching for and reporting on AD users

Finding expired computers in AD

Creating and e-mailing a superuser report

Managing IIS with PowerShell


Installing and configuring IIS

Configuring IIS for SSL

Configuring a Central Certificate Store

Configuring IIS bindings

Configuring IIS logging

Managing log files

Configuring NLB across multiple servers

Monitoring load balancing across NLB nodes

Placing NLB nodes into maintenance

Configuring a development/staging/production site scheme

Promoting content in websites

Reporting on website access and errors

Managing Hyper-V with PowerShell


Installing and configuring Hyper-V

Configuring NUMA

Securing Hyper-V

Hyper-V networking

Creating virtual machines

Managing VM state

Configuring VM networking

Configuring VM hardware

Quickly deploying VMs using a template

Managing and reporting on VM snapshots

Monitoring Hyper-V utilization and performance

Synchronizing networks between Hyper-V hosts

Hyper-V replication

Migrating VMs between hosts

Migrating VM storage between hosts

Using failover clustering to make VMs highly available

Managing Storage with PowerShell


Managing NTFS file permissions

Managing NTFS alternate streams

Configuring NTFS deduplication

Monitoring NTFS deduplication

Configuring storage pools

Reporting on storage pools

Managing file quotas

Managing Network Shares with PowerShell


Creating and securing CIFS shares

Accessing CIFS shares from PowerShell

Creating iSCSI target and virtual disk

Using a iSCSI disk

Configuring and using iSNS

Creating an NFS export

Mounting NFS exports

Making CIFS shares highly available

Configuring DFS and DFSR replication

Configuring BranchCache

Managing Windows Updates with PowerShell


Installing Windows Server Update Services

Configuring WSUS update synchronization

Configuring the Windows update client

Creating computer groups

Configuring WSUS auto-approvals

Reporting missing updates

Installing updates

Uninstalling updates

Configuring WSUS to inventory clients

Creating an update report

Exporting WSUS data to Excel

Managing Printers with PowerShell


Setting up and sharing printers

Changing printer drivers

Reporting on printer security

Adding and removing printer security

Mapping clients to printers

Enabling Branch Office Direct Printing

Reporting on printer usage

Troubleshooting Servers with PowerShell


Testing if a server is responding

Using troubleshooting packs

Using Best Practices Analyzers

Searching event logs for specific events

Forwarding event logs to a central log server

Managing Performance with PowerShell


Reading performance counters

Configuring Data Collector Sets

Reporting on performance data

Generating graphs

Creating a server performance report

Inventorying Servers with PowerShell


Inventorying hardware with PowerShell

Inventorying the installed software

Inventory system configuration

Reporting on system security

Creating a change report

Exporting a configuration report to Word

Server Backup


Configuring backup policies

Initiating backups manually

Restoring files

Restoring Windows system state

Restoring application data

Creating a daily backup report