Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
7
Automation in Windows Server 2016
Module Agenda
The automation landscape
PowerShell investments
Delivering PowerShell code faster
PowerShell Web Access and
Workflows
PowerShell DSC
The automation
landscape.
Automation
Partner
s
O
IS
E
Vs
Mana Auto
Ms mati
geme
Microsoft
Syste
m
Cent
Servi
ce er
Mana
gem
ent
Auto
mati
on
Orch
estra
tor
Azure
Azur
e
Auto
mati
on
Azur
e
DSC
nt
Prod
ucts
on
Prod
ucts
Windows Server
PowerShell
PowerShell
Workflow
Just Enough
Admin
Desired State
Configuration
PowerShell
Investments.
PowerShell Progression
Version
Monad Manifesto
Server
Server 2000
Key Feature
Vision and
prototype
PowerShell Progression
Version
Monad Manifesto
Server
Server 2000
PowerShell 1.0
Server 2008
Key Feature
Vision and
prototype
.Net Cmdlets*
PowerShell Progression
Version
Monad Manifesto
Server
Server 2000
PowerShell 1.0
PowerShell 2.0
Server 2008
Server 2008 R2
Key Feature
Vision and
prototype
.Net Cmdlets
Remoting*
PowerShell Progression
Version
Monad Manifesto
Server
Server 2000
PowerShell 1.0
PowerShell 2.0
PowerShell 3.0
Server 2008
Server 2008 R2
Server 2012
Key Feature
Vision and
prototype
.Net Cmdlets
Remoting
Coverage*
PowerShell Progression
Version
Monad Manifesto
Server
Server 2000
PowerShell
PowerShell
PowerShell
PowerShell
Server
Server
Server
Server
1.0
2.0
3.0
4.0
2008
2008 R2
2012
2012 R2
Key Feature
Vision and
prototype
.Net Cmdlets
Remoting
Coverage
Desired State
Config*
PowerShell Progression
Version
Monad Manifesto
Server
Server 2000
PowerShell
PowerShell
PowerShell
PowerShell
Server
Server
Server
Server
1.0
2.0
3.0
4.0
PowerShell 5.0
2008
2008 R2
2012
2012 R2
Server 2016
Key Feature
Vision and
prototype
.Net Cmdlets
Remoting
Coverage
Desired State
Config
DevOps*
Compress-Archive / Expand-Archive
Convert-String / ConvertFrom-String
Format-Hex
New-Guid
Clipboard cmdlets
New-TemporaryFile
Clear-RecycleBin
Get-ChildItem -Depth
Remote Management
Remote script debugging
Remote script editing in ISE
Host process attach and debug
File copy over PowerShell sessions
PowerShell remoting over VMBus
Delivering PowerShell
Code Faster.
Improved Authoring of
PowerShell ISE Improvements
PowerShell
Edit remote PS scripts & files in local ISE -> Enter-PSSession then
running PSEdit <path and file name on the remote
computer>.
This feature eases editing Windows PowerShell files that are stored
on the Server Core installation option of Windows Server, where
Windows PowerShell ISE cannot run.
The Start-Transcript cmdlet is now supported in Windows
PowerShell ISE.
You can now debug remote scripts in Windows PowerShell ISE.
A new menu command, Break All (Ctrl+B), breaks into the
debugger for both local and remotely-running scripts.
PoshCode
Pester
Remote Debugging
PowerShell Web
Access
and Workflows
03
PowerShell
Workflow
Windows
PowerShell
Workflow
A set of longrunning
activities (in
sequence or in
parallel) that
perform
complex
management
tasks, such as
multi-machine
application
provisioning.
Authored
using
a Windows
PowerShell
script or the
Visual Studio
Workflow
Designer
(XAML).
Workflows
survive
system
interruption
s (reboots,
network
problems):
suspend-job/
resume-job,
persist state
and metadata.
PowerShell Workflow
Join-Domain through Workflow
workflow Join-Domain
{
param(
[Parameter(Mandatory)]
[string]$DomainName,
[Parameter(Mandatory)]
[PSCredential]$DomainCredential
)
Get-CimInstance -ClassName win32_computersystem
Add-Computer -Credential $DomainCredential -DomainName $DomainName -LocalCredential $PSCredential
Restart-Computer -Force -Wait
Get-CimInstance -ClassName win32_computersystem
}
# Usage
Join-Domain -PSComputerName <list of machines> -PSCredential <local admin credential> -DomainName
<domain name> -DomainCredential <credential that can join machine to domain>
PowerShell DSC.
drift
Flexible deployment
options
Enables continuous
deployment
Modules available from
PS Gallery
PowerShell DSC
But what can it do for me?
Install or remove server roles and features
Manage registry settings
Manage files and directories
Start, stop, and manage processes and services
Manage local groups and user accounts
Install and manage packages such as .msi and .exe
Manage environment variables
Run Windows PowerShell scripts
Fix a configuration that has drifted away from the desired state
Discover the actual configuration state on a given node
DSC Leverage
Traditional
Scripts
Depende
ncy
Resolutio
Int
n
en
r
t
o
r
r
E
& g
g
i n dlin
g
Log Han
Reboo
t
R
e
silienc
Rep
y
ea t
abl
eA
uto
ma
tion
Technology
Specific
Configuration
Intent
DSC Engine
Dependency Resolution
Logging & Error
Handling
Reboot Resiliency
Repeatable Automation
Resources
Technology Specific
DSC Decouples
Configuration
Intent
DSC Engine
Dependency
Resolution
Logging & Error
Handling
Reboot Resiliency
Repeatable
Resources Automation
Technology Specific
Intent
WHAT : Structural Configuration
Stays same irrespective of the
environment
WHERE : Environmental Configuration
Changes as system goes through
different env.
Dev Test Production
Make It So
HOW : DSC Resources
Do the heavy lifting in an idempotent
way
Neither a MOF file nor a DSCResource subfolder in the module folder is required
Gives additional flexibility
Not only logged in event log, but sent to central location for further analysis
Send errors for any server in the environment
Sent to a Report Server and stored in a database works with push/pull configurations
PSDscRunAsCredential
New delegation security feature, leverages DSC and Windows PowerShell constrained runspaces
to help secure enterprises from data loss or compromise by employees, whether
intentional or unintentional
Further detail:
https://technet.microsoft.com/library/hh857339.aspx#BKMK_newDSC
Demo.
DSC
2015 Microsoft Corporation. All rights reserved. Microsoft, Windows and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.
The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be
interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR
STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.