SlideShare ist ein Scribd-Unternehmen logo
1 von 58
Downloaden Sie, um offline zu lesen
Powershell et les techniques de remoting
PowerShell et les
techniques de remoting

Carlo Mancini - MVP Powershell - STMicroElectronics
Fabien Dibot - Ingénieur Systèmes - Vivalto Santé

@fdibot - @sysadm2010

Infrastructure, communication & collaboration
Donnez votre avis !
Depuis votre smartphone sur :
http://notes.mstechdays.fr
De nombreux lots à gagner toute les heures !!!
Claviers, souris et jeux Microsoft…
Merci de nous aider à améliorer les Techdays !

#mstechdays

Infrastructure, communication & collaboration
POWERSHELL REMOTING

#mstechdays

Infrastructure, communication & collaboration
SOMMAIRE
1.
2.
3.
4.

Un peu d’histoire
WinRM
Les Sessions
Common Information Model

#mstechdays

Infrastructure, communication & collaboration
UN PEU D’HISTOIRE

#mstechdays

Infrastructure, communication & collaboration
PowerShell, deux constats et un peu
d’histoire
• Montée en puissance de:
– Windows 7 (45% du marché)
– Windows 8 (10%)

• Microsoft 'big shift':
de la GUI vers
Powershell
#mstechdays

Infrastructure, communication & collaboration
L’évolution de Powershell Remoting
Avant Powershell

Powershell 1.0

Powershell 2.0

Powershell 3.0

Remote Desktop
Connection (RDP)

Get-WMIObject
-Computername

Cmdlets CIM
Get-CIMInstance

Sysinternals PsTools
• PsExec
• PsList
• PsFile

Pas de paramètre
–Credential

Paramètre –
ComputerName
dans 35 cmdlets
• Get-Process
• Get-Service
• Restart-Computer
• Get-WinEvent

Sessions robustes

Remoting

Remoting implicite

Logiciel tiers

Protocole
DCOM/RPC

Sessions
deconnectées

Windows PWA
#mstechdays

Infrastructure, communication & collaboration
Powershell Remoting, sauce 1.0…
... c'était du bricolage...

#mstechdays

Infrastructure, communication & collaboration
Le problème avec DCOM/RPC

Get-WMIObject

#mstechdays

Infrastructure, communication & collaboration
RPC/DCOM vs Parefeu
• le parefeu gagne...

#mstechdays

Infrastructure, communication & collaboration
Le nouveau paradigme
• Exploite le service WinRM
– WinRM 1.0
• installé par défaut sur Vista
• Ports 80 et 443
– WinRM 1.1
• sur Vista SP1 et 2008 SP1
• installable sur XP SP2, 2003 et 2003 R2
– WinRM 2.0
• sur Seven et sur 2008 R2
• Installable sur XP SP3, Vista (SP1 ou SP2), et 2008 (SP1 ou
SP2)
• Ports 5985 (http) et 5986 (https)

• Introduit la notion de Session
Infrastructure, communication & collaboration

#mstechdays
WINRM

#mstechdays

Infrastructure, communication & collaboration
WinRM
• Windows Remote Management
• Basé sur le standard WS-Man (Web
Services for Management)
• S’appuie sur SOAP
• Firewall-friendly

#mstechdays

Infrastructure, communication & collaboration
Architecture et EndPoints
Powershell.exe

Serveur distant

Powershell.exe

....exe

Endpoint
Powershell 64-bit

Endpoint
Powershell 32-bit

Autre Endpoint

Service WinRM
http
listener

WS-MAN

Station de travail

#mstechdays

Infrastructure, communication & collaboration
WinRM et la sécurité
Communication chiffrée entre les machines :
• Utilisation des jetons Kerberos.
• NTLM
Pour lancer des scripts et/ou cmdlets:
• Utilisateur membre du groupe Administrateurs local
• Fournir des credentials Administrateur
• Accéder à la configuration de la session
PowerShell
• Sessions paramétrables & collaboration
#mstechdays
Infrastructure, communication
Installation de WinRM
•

WinRM Quickconfig

#mstechdays

Infrastructure, communication & collaboration
Installation de WinRM
•

Enable PSRemoting

#mstechdays

Infrastructure, communication & collaboration
Installation de WinRM
• GPO
–
–
–
–
–

#mstechdays

Computer Configuration
Administrative Templates
Windows Components
Windows Remote Management
WinRM Service

Infrastructure, communication & collaboration
Vérifications
• Vérifier la connexion localement:
– winrm quickconfig

– Enter-PSSession -ComputerName localhost

#mstechdays

Infrastructure, communication & collaboration
Configuration 1/4
• Voir votre configuration :
– winrm get winrm/config
– winrm enumerate winrm/config/listener
– ls WSMan:localhostShell

#mstechdays

Infrastructure, communication & collaboration
Configuration 2/4

#mstechdays

Infrastructure, communication & collaboration
Configuration 3/4

#mstechdays

Infrastructure, communication & collaboration
Configuration 4/4

#mstechdays

Infrastructure, communication & collaboration
WinRM.. Des limitations….
Par défaut:
• 30 sessions par utilisateur et par machine
• 10 utilisateurs
• 25 cmdlets simultanées, le reste en queue
• 1024MB assigné par session

#mstechdays

Infrastructure, communication & collaboration
Modifiables !

#mstechdays

Infrastructure, communication & collaboration
LES SESSIONS

#mstechdays

Infrastructure, communication & collaboration
Modèles de Remoting
• Fan-Out, 1-to-many
• 1-to-1, SSH-style

#mstechdays

Infrastructure, communication & collaboration
Remoting 1-to-many

• Invoke-Command

#mstechdays

Infrastructure, communication & collaboration
Invoke-Command et les objets
désérialisés

• On peut travailler avec la sortie de commande de
quasiment la même manière que toute autre sortie de
commande

#mstechdays

Infrastructure, communication & collaboration
Invoke-Command mais pas de méthodes
• Les objets désérialisés que notre station reçoit sur le
pipeline ne sont qu'un snapshot de l'objet original

#mstechdays

Infrastructure, communication & collaboration
Invoke-Command et Select-Object
• La sérialisation et désérialisation des données a un coût
très fort en terme de paquets envoyés sur le réseau
• Bonne pratique: utiliser Select-Object sur l'objet distant
optimise l'envoi des données sur le réseau

#mstechdays

Infrastructure, communication & collaboration
Invoke-Command sans erreur
• Invoke-Command est sujet aux erreurs de frappe
• On peut utiliser des scripts .ps1
• Paramètre -FilePath

Invoke-Command `
-ComputerName vm2008R25,vm2008R26 `
-FilePath C:MyScript.ps1

#mstechdays

Infrastructure, communication & collaboration
Le paramètre -AsJob
• Invoke-Command peut être utilisé avec le paramètre –AsJob
– la commande est exécutée de façon asynchrone en arrière-plan
– l’invite Windows PowerShell est immédiatement retourné

#mstechdays

Infrastructure, communication & collaboration
Remoting SSH-style

#mstechdays

Infrastructure, communication & collaboration
Exemple de session interactive temporaire

#mstechdays

Infrastructure, communication & collaboration
Sessions distantes persistantes
• Les sessions temporaires ne sont pas
efficientes
– Overhead à l'initialization de chaque session
– Overhead pour le tear-down de chaque session

• L’alternative: New-PSSession
– pour démarrer une nouvelle session
persistante
• Get-PSSession –ComputerName
– pour voir une session existante
#mstechdays
Infrastructure, communication & collaboration
La variable $Session
• … ou comment faire du Invoke-Command sur une session
persistante

#mstechdays

Infrastructure, communication & collaboration
Rajouter une nouvelle session

#mstechdays

Infrastructure, communication & collaboration
Interagir avec une session persistante
• Enter-PSSession accepte le paramètre -Session
– La commande Exit-PSSession ne supprime pas la
session

#mstechdays

Infrastructure, communication & collaboration
Sessions déconnectées
• Nouveauté dans Powershell 3.0
• Connect-PSSession et DisconnectPSSession
• La reconnexion peut se faire:
– du poste client où la session a été créée
– à partir d'un autre poste (mais toujours
avec le même compte)
– Powershell 3.0/4.0 installé des deux

#mstechdays

Infrastructure, communication & collaboration
Exemples de sessions déconnectées

#mstechdays

Infrastructure, communication & collaboration
Invoke-Command et les sessions
persistantes

• Paramètre -InDisconnectedSession
– depuis Powershell 3.0 permet à Invoke-Command de profiter de
la flexibilité et robustesse des sessions déconnectées
– la session est crée, la commande exécutée et la session est
fermée avant qu'une sortie soit produite

#mstechdays

Infrastructure, communication & collaboration
Détruire une session persistante
• Remove-PSSession

#mstechdays

Infrastructure, communication & collaboration
Implicit Remoting
• Pas de module sur votre station de travail ?
• Pas envie d'installer RSAT ?
• Import-PSSession
– importe des cmdlets à partir d'une session PSSession
d'un ordinateur local ou distant dans la session active.

#mstechdays

Infrastructure, communication & collaboration
Exemple de Implicit Remoting

#mstechdays

Infrastructure, communication & collaboration
COMMON INFORMATION MODEL

#mstechdays

Infrastructure, communication & collaboration
Un peu d’histoire…
• WMI intégré à tous les OS Microsoft.
• WMI construit sur la base WBEM et CIM de la
DMTF
• CIM permet une interface commune pour le
management:
– OS Windows et Linux
– Equipements réseaux
– Solution de virtualisation

• PowerShell 1 et 2 -> WMI et accélérateurs
• PowerShell 3 et 4 ->communication & collaboration
Module CIMCmdlets
#mstechdays
Infrastructure,
Les CMDLets CIM

#mstechdays

Infrastructure, communication & collaboration
Créer une session

#mstechdays

Infrastructure, communication & collaboration
Session avec options

#mstechdays

Infrastructure, communication & collaboration
Exécutions multiples

#mstechdays

Infrastructure, communication & collaboration
Exécuter une méthode

#mstechdays

Infrastructure, communication & collaboration
Limitations
• Plus limité que WMI, actuellement:
– Impossibilité de passer le paramètre credential sans créer une
session
– Certaines Classes WMI sont manquantes
– Impossibilité d’appeler des Objets/Méthodes .NET

#mstechdays

Infrastructure, communication & collaboration
DES QUESTIONS ?

#mstechdays

Infrastructure, communication & collaboration
Pour aller plus loin…
http://aka.ms/MVA

Offre spéciale TechDays limitée aux 200
premières demandes, 1 pack par individu

http://aka.ms/jeveuxwindows2012

Approfondissez

Microsoft System Center 2012

Agenda des séminaires
techniques pour les IT Pros :
http://aka.ms/itcamps-france
Agenda des séminaires
fonctionnels pour les décideurs :
http://aka.ms/TDI
#mstechdays

http://aka.ms/jeveuxmoncloudprive

http://aka.ms/free/trial

Infrastructure, communication & collaboration
RESSOURCES
•
•
•
•
•
•
•
•
•
•

http://powershell-scripting.com – FR
http://lazywinadmin.com - US
http://learn-powershell.net – US
http://powershell.org – US
http://via-powershell.fr - FR
http://shellyourexperience.com - US
http://my-powershell.fr - FR
http://jdhitsolutions.com/blog -US
http://happysysadm.com – US
http://pwrshell.net – FR

#mstechdays

Infrastructure, communication & collaboration
Digital is
business

Weitere ähnliche Inhalte

Was ist angesagt?

Installing and Configuring NGINX Open Source
Installing and Configuring NGINX Open SourceInstalling and Configuring NGINX Open Source
Installing and Configuring NGINX Open SourceNGINX, Inc.
 
FD.IO Vector Packet Processing
FD.IO Vector Packet ProcessingFD.IO Vector Packet Processing
FD.IO Vector Packet ProcessingKernel TLV
 
Integrations - Thinking outside the box - Presentation Engage 2023 in Amsterdam
Integrations - Thinking outside the box - Presentation Engage 2023 in AmsterdamIntegrations - Thinking outside the box - Presentation Engage 2023 in Amsterdam
Integrations - Thinking outside the box - Presentation Engage 2023 in AmsterdamRoland Driesen
 
Linux Profiling at Netflix
Linux Profiling at NetflixLinux Profiling at Netflix
Linux Profiling at NetflixBrendan Gregg
 
Implementing High Availability Caching with Memcached
Implementing High Availability Caching with MemcachedImplementing High Availability Caching with Memcached
Implementing High Availability Caching with MemcachedGear6
 
OpenStack Oslo Messaging RPC API Tutorial Demo Call, Cast and Fanout
OpenStack Oslo Messaging RPC API Tutorial Demo Call, Cast and FanoutOpenStack Oslo Messaging RPC API Tutorial Demo Call, Cast and Fanout
OpenStack Oslo Messaging RPC API Tutorial Demo Call, Cast and FanoutSaju Madhavan
 
Docker と ECS と WebSocket で最強のマルチプレイ・ゲームサーバを構築
Docker と ECS と WebSocket で最強のマルチプレイ・ゲームサーバを構築Docker と ECS と WebSocket で最強のマルチプレイ・ゲームサーバを構築
Docker と ECS と WebSocket で最強のマルチプレイ・ゲームサーバを構築gree_tech
 
Tutorial: Using GoBGP as an IXP connecting router
Tutorial: Using GoBGP as an IXP connecting routerTutorial: Using GoBGP as an IXP connecting router
Tutorial: Using GoBGP as an IXP connecting routerShu Sugimoto
 
Learn everything about IBM iNotes Customization
Learn everything about IBM iNotes CustomizationLearn everything about IBM iNotes Customization
Learn everything about IBM iNotes CustomizationIBM Connections Developers
 
INF107 - Integrating HCL Domino and Microsoft 365
INF107 - Integrating HCL Domino and Microsoft 365INF107 - Integrating HCL Domino and Microsoft 365
INF107 - Integrating HCL Domino and Microsoft 365Dylan Redfield
 
Linux Systems Performance 2016
Linux Systems Performance 2016Linux Systems Performance 2016
Linux Systems Performance 2016Brendan Gregg
 
Root file system
Root file systemRoot file system
Root file systemBindu U
 
Linux.ppt
Linux.ppt Linux.ppt
Linux.ppt onu9
 
Data Structures used in Linux kernel
Data Structures used in Linux kernel Data Structures used in Linux kernel
Data Structures used in Linux kernel assinha
 
Linux Knowledge Transfer
Linux Knowledge TransferLinux Knowledge Transfer
Linux Knowledge TransferTapio Vaattanen
 
OpenStackで始めるクラウド環境構築入門
OpenStackで始めるクラウド環境構築入門OpenStackで始めるクラウド環境構築入門
OpenStackで始めるクラウド環境構築入門VirtualTech Japan Inc.
 
Patroni - HA PostgreSQL made easy
Patroni - HA PostgreSQL made easyPatroni - HA PostgreSQL made easy
Patroni - HA PostgreSQL made easyAlexander Kukushkin
 
Linux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old SecretsLinux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old SecretsBrendan Gregg
 
Domino Fitness. Time for a Health Check
Domino Fitness. Time for a Health CheckDomino Fitness. Time for a Health Check
Domino Fitness. Time for a Health CheckJared Roberts
 
Linux booting process - Linux System Administration
Linux booting process - Linux System AdministrationLinux booting process - Linux System Administration
Linux booting process - Linux System AdministrationSreenatha Reddy K R
 

Was ist angesagt? (20)

Installing and Configuring NGINX Open Source
Installing and Configuring NGINX Open SourceInstalling and Configuring NGINX Open Source
Installing and Configuring NGINX Open Source
 
FD.IO Vector Packet Processing
FD.IO Vector Packet ProcessingFD.IO Vector Packet Processing
FD.IO Vector Packet Processing
 
Integrations - Thinking outside the box - Presentation Engage 2023 in Amsterdam
Integrations - Thinking outside the box - Presentation Engage 2023 in AmsterdamIntegrations - Thinking outside the box - Presentation Engage 2023 in Amsterdam
Integrations - Thinking outside the box - Presentation Engage 2023 in Amsterdam
 
Linux Profiling at Netflix
Linux Profiling at NetflixLinux Profiling at Netflix
Linux Profiling at Netflix
 
Implementing High Availability Caching with Memcached
Implementing High Availability Caching with MemcachedImplementing High Availability Caching with Memcached
Implementing High Availability Caching with Memcached
 
OpenStack Oslo Messaging RPC API Tutorial Demo Call, Cast and Fanout
OpenStack Oslo Messaging RPC API Tutorial Demo Call, Cast and FanoutOpenStack Oslo Messaging RPC API Tutorial Demo Call, Cast and Fanout
OpenStack Oslo Messaging RPC API Tutorial Demo Call, Cast and Fanout
 
Docker と ECS と WebSocket で最強のマルチプレイ・ゲームサーバを構築
Docker と ECS と WebSocket で最強のマルチプレイ・ゲームサーバを構築Docker と ECS と WebSocket で最強のマルチプレイ・ゲームサーバを構築
Docker と ECS と WebSocket で最強のマルチプレイ・ゲームサーバを構築
 
Tutorial: Using GoBGP as an IXP connecting router
Tutorial: Using GoBGP as an IXP connecting routerTutorial: Using GoBGP as an IXP connecting router
Tutorial: Using GoBGP as an IXP connecting router
 
Learn everything about IBM iNotes Customization
Learn everything about IBM iNotes CustomizationLearn everything about IBM iNotes Customization
Learn everything about IBM iNotes Customization
 
INF107 - Integrating HCL Domino and Microsoft 365
INF107 - Integrating HCL Domino and Microsoft 365INF107 - Integrating HCL Domino and Microsoft 365
INF107 - Integrating HCL Domino and Microsoft 365
 
Linux Systems Performance 2016
Linux Systems Performance 2016Linux Systems Performance 2016
Linux Systems Performance 2016
 
Root file system
Root file systemRoot file system
Root file system
 
Linux.ppt
Linux.ppt Linux.ppt
Linux.ppt
 
Data Structures used in Linux kernel
Data Structures used in Linux kernel Data Structures used in Linux kernel
Data Structures used in Linux kernel
 
Linux Knowledge Transfer
Linux Knowledge TransferLinux Knowledge Transfer
Linux Knowledge Transfer
 
OpenStackで始めるクラウド環境構築入門
OpenStackで始めるクラウド環境構築入門OpenStackで始めるクラウド環境構築入門
OpenStackで始めるクラウド環境構築入門
 
Patroni - HA PostgreSQL made easy
Patroni - HA PostgreSQL made easyPatroni - HA PostgreSQL made easy
Patroni - HA PostgreSQL made easy
 
Linux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old SecretsLinux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old Secrets
 
Domino Fitness. Time for a Health Check
Domino Fitness. Time for a Health CheckDomino Fitness. Time for a Health Check
Domino Fitness. Time for a Health Check
 
Linux booting process - Linux System Administration
Linux booting process - Linux System AdministrationLinux booting process - Linux System Administration
Linux booting process - Linux System Administration
 

Andere mochten auch

Réduisez vos Coûts d'Administration et les Risques d'erreurs avec Windows Pow...
Réduisez vos Coûts d'Administration et les Risques d'erreurs avec Windows Pow...Réduisez vos Coûts d'Administration et les Risques d'erreurs avec Windows Pow...
Réduisez vos Coûts d'Administration et les Risques d'erreurs avec Windows Pow...Patrick Guimonet
 
2008-09-30 Administration automatisée avec Powershell
2008-09-30 Administration automatisée avec Powershell2008-09-30 Administration automatisée avec Powershell
2008-09-30 Administration automatisée avec PowershellPatrick Guimonet
 
Power Shell V2 en action - avec Posh Board 2.0
Power Shell V2 en action - avec Posh Board 2.0Power Shell V2 en action - avec Posh Board 2.0
Power Shell V2 en action - avec Posh Board 2.0Patrick Guimonet
 
Using PowerShell for active directory management
Using PowerShell for active directory managementUsing PowerShell for active directory management
Using PowerShell for active directory managementRavikanth Chaganti
 
F Les Scripts En Power Shell
F Les Scripts En Power ShellF Les Scripts En Power Shell
F Les Scripts En Power ShellUGAIA
 
Automatisez rapidement vos opérations IT, on-premise ou dans le Cloud avec Az...
Automatisez rapidement vos opérations IT, on-premise ou dans le Cloud avec Az...Automatisez rapidement vos opérations IT, on-premise ou dans le Cloud avec Az...
Automatisez rapidement vos opérations IT, on-premise ou dans le Cloud avec Az...Microsoft Technet France
 
Cao COMT manuscript
Cao COMT manuscriptCao COMT manuscript
Cao COMT manuscriptyufeicao
 
Powershell
PowershellPowershell
PowershellUGAIA
 
An Introduction to Windows PowerShell
An Introduction to Windows PowerShellAn Introduction to Windows PowerShell
An Introduction to Windows PowerShellDale Lane
 
Comment automatiser les commandes PowerShell pour optimiser la performance d'...
Comment automatiser les commandes PowerShell pour optimiser la performance d'...Comment automatiser les commandes PowerShell pour optimiser la performance d'...
Comment automatiser les commandes PowerShell pour optimiser la performance d'...Microsoft Décideurs IT
 
Shell sans les coquilles
Shell sans les coquillesShell sans les coquilles
Shell sans les coquillesÉdouard Lopez
 
Réaction antigène-anticorps appliquée en techniques immunologiques
Réaction antigène-anticorps appliquée en techniques immunologiquesRéaction antigène-anticorps appliquée en techniques immunologiques
Réaction antigène-anticorps appliquée en techniques immunologiquesAsmae LGUENSAT
 

Andere mochten auch (15)

Réduisez vos Coûts d'Administration et les Risques d'erreurs avec Windows Pow...
Réduisez vos Coûts d'Administration et les Risques d'erreurs avec Windows Pow...Réduisez vos Coûts d'Administration et les Risques d'erreurs avec Windows Pow...
Réduisez vos Coûts d'Administration et les Risques d'erreurs avec Windows Pow...
 
2008-09-30 Administration automatisée avec Powershell
2008-09-30 Administration automatisée avec Powershell2008-09-30 Administration automatisée avec Powershell
2008-09-30 Administration automatisée avec Powershell
 
Power Shell V2 en action - avec Posh Board 2.0
Power Shell V2 en action - avec Posh Board 2.0Power Shell V2 en action - avec Posh Board 2.0
Power Shell V2 en action - avec Posh Board 2.0
 
Using PowerShell for active directory management
Using PowerShell for active directory managementUsing PowerShell for active directory management
Using PowerShell for active directory management
 
F Les Scripts En Power Shell
F Les Scripts En Power ShellF Les Scripts En Power Shell
F Les Scripts En Power Shell
 
Automatisez rapidement vos opérations IT, on-premise ou dans le Cloud avec Az...
Automatisez rapidement vos opérations IT, on-premise ou dans le Cloud avec Az...Automatisez rapidement vos opérations IT, on-premise ou dans le Cloud avec Az...
Automatisez rapidement vos opérations IT, on-premise ou dans le Cloud avec Az...
 
Powershell Demo Presentation
Powershell Demo PresentationPowershell Demo Presentation
Powershell Demo Presentation
 
Cao COMT manuscript
Cao COMT manuscriptCao COMT manuscript
Cao COMT manuscript
 
Powershell
PowershellPowershell
Powershell
 
An Introduction to Windows PowerShell
An Introduction to Windows PowerShellAn Introduction to Windows PowerShell
An Introduction to Windows PowerShell
 
Comment automatiser les commandes PowerShell pour optimiser la performance d'...
Comment automatiser les commandes PowerShell pour optimiser la performance d'...Comment automatiser les commandes PowerShell pour optimiser la performance d'...
Comment automatiser les commandes PowerShell pour optimiser la performance d'...
 
Shell sans les coquilles
Shell sans les coquillesShell sans les coquilles
Shell sans les coquilles
 
De l'antigène à l'anticorps
De l'antigène à l'anticorpsDe l'antigène à l'anticorps
De l'antigène à l'anticorps
 
Réaction antigène-anticorps appliquée en techniques immunologiques
Réaction antigène-anticorps appliquée en techniques immunologiquesRéaction antigène-anticorps appliquée en techniques immunologiques
Réaction antigène-anticorps appliquée en techniques immunologiques
 
Sp summit2014 session 10-2
Sp summit2014   session 10-2Sp summit2014   session 10-2
Sp summit2014 session 10-2
 

Ähnlich wie Powershell et les techniques de remoting

Migration des réseaux d agence : les apports de Windows Server 2012 R2
Migration des réseaux d agence : les apports de Windows Server 2012 R2Migration des réseaux d agence : les apports de Windows Server 2012 R2
Migration des réseaux d agence : les apports de Windows Server 2012 R2Microsoft
 
Périphériques non-Windows et SCCM – Intégrations et management
Périphériques non-Windows et SCCM – Intégrations et managementPériphériques non-Windows et SCCM – Intégrations et management
Périphériques non-Windows et SCCM – Intégrations et managementMicrosoft Technet France
 
Transformer votre Cloud : est-ce si simple ? La réponse avec les solutions EM...
Transformer votre Cloud : est-ce si simple ? La réponse avec les solutions EM...Transformer votre Cloud : est-ce si simple ? La réponse avec les solutions EM...
Transformer votre Cloud : est-ce si simple ? La réponse avec les solutions EM...Microsoft Ideas
 
Nouveaux scénarios de déploiement avec SCCM 2012 SP1
Nouveaux scénarios de déploiement avec SCCM 2012 SP1Nouveaux scénarios de déploiement avec SCCM 2012 SP1
Nouveaux scénarios de déploiement avec SCCM 2012 SP1Microsoft Technet France
 
System Center 2012 R2 en environnement hétérogène et hybride
System Center 2012 R2 en environnement hétérogène et hybrideSystem Center 2012 R2 en environnement hétérogène et hybride
System Center 2012 R2 en environnement hétérogène et hybrideMicrosoft Technet France
 
System Center 2012 R2 en environnement hétérogène et hybride
System Center 2012 R2 en environnement hétérogène et hybrideSystem Center 2012 R2 en environnement hétérogène et hybride
System Center 2012 R2 en environnement hétérogène et hybrideMicrosoft
 
Administration intégrée HP/Microsoft des serveurs HP ProLiant
Administration intégrée HP/Microsoft des serveurs HP ProLiantAdministration intégrée HP/Microsoft des serveurs HP ProLiant
Administration intégrée HP/Microsoft des serveurs HP ProLiantMicrosoft Technet France
 
Au coeur du framework .net 4.5.1
Au coeur du framework .net 4.5.1Au coeur du framework .net 4.5.1
Au coeur du framework .net 4.5.1Cellenza
 
System Center 2012 : Montez votre Cloud Privé avec NetApp et Cisco
System Center 2012 : Montez votre Cloud Privé avec NetApp et Cisco System Center 2012 : Montez votre Cloud Privé avec NetApp et Cisco
System Center 2012 : Montez votre Cloud Privé avec NetApp et Cisco Microsoft Technet France
 
Au cœur du Framework .NET 4.5.1
Au cœur du Framework .NET 4.5.1Au cœur du Framework .NET 4.5.1
Au cœur du Framework .NET 4.5.1Microsoft
 
[Scrum Day 2011] Outillage Agile dans un environnement Microsoft
[Scrum Day 2011] Outillage Agile dans un environnement Microsoft[Scrum Day 2011] Outillage Agile dans un environnement Microsoft
[Scrum Day 2011] Outillage Agile dans un environnement MicrosoftChristophe HERAL
 
Cycle de vie d'un projet web agile avec TFS 2013, Azure VM et Monaco
Cycle de vie d'un projet web agile avec TFS 2013, Azure VM et MonacoCycle de vie d'un projet web agile avec TFS 2013, Azure VM et Monaco
Cycle de vie d'un projet web agile avec TFS 2013, Azure VM et MonacoMicrosoft
 
Services de bureaux distants dans Windows Server 2012 R2 et Azure
Services de bureaux distants dans Windows Server 2012 R2 et AzureServices de bureaux distants dans Windows Server 2012 R2 et Azure
Services de bureaux distants dans Windows Server 2012 R2 et AzureMicrosoft Technet France
 
Symfony2 et Microsoft Azure, l’efficacité de PHP dans le cloud
Symfony2 et Microsoft Azure, l’efficacité de PHP dans le cloud Symfony2 et Microsoft Azure, l’efficacité de PHP dans le cloud
Symfony2 et Microsoft Azure, l’efficacité de PHP dans le cloud Microsoft
 
Power shell saturday Paris 2017 Omiossec
Power shell saturday  Paris 2017 OmiossecPower shell saturday  Paris 2017 Omiossec
Power shell saturday Paris 2017 OmiossecOlivier Miossec
 
Tech daysRetour d’expérience Big Compute & HPC sur Windows Azure [TechDays 2014]
Tech daysRetour d’expérience Big Compute & HPC sur Windows Azure [TechDays 2014]Tech daysRetour d’expérience Big Compute & HPC sur Windows Azure [TechDays 2014]
Tech daysRetour d’expérience Big Compute & HPC sur Windows Azure [TechDays 2014]ANEO
 
Déploiment des tablettes et gestion du parc informatique dans les établisseme...
Déploiment des tablettes et gestion du parc informatique dans les établisseme...Déploiment des tablettes et gestion du parc informatique dans les établisseme...
Déploiment des tablettes et gestion du parc informatique dans les établisseme...Microsoft Ideas
 

Ähnlich wie Powershell et les techniques de remoting (20)

Migration des réseaux d agence : les apports de Windows Server 2012 R2
Migration des réseaux d agence : les apports de Windows Server 2012 R2Migration des réseaux d agence : les apports de Windows Server 2012 R2
Migration des réseaux d agence : les apports de Windows Server 2012 R2
 
Périphériques non-Windows et SCCM – Intégrations et management
Périphériques non-Windows et SCCM – Intégrations et managementPériphériques non-Windows et SCCM – Intégrations et management
Périphériques non-Windows et SCCM – Intégrations et management
 
Transformer votre Cloud : est-ce si simple ? La réponse avec les solutions EM...
Transformer votre Cloud : est-ce si simple ? La réponse avec les solutions EM...Transformer votre Cloud : est-ce si simple ? La réponse avec les solutions EM...
Transformer votre Cloud : est-ce si simple ? La réponse avec les solutions EM...
 
Nouveaux scénarios de déploiement avec SCCM 2012 SP1
Nouveaux scénarios de déploiement avec SCCM 2012 SP1Nouveaux scénarios de déploiement avec SCCM 2012 SP1
Nouveaux scénarios de déploiement avec SCCM 2012 SP1
 
System Center 2012 R2 en environnement hétérogène et hybride
System Center 2012 R2 en environnement hétérogène et hybrideSystem Center 2012 R2 en environnement hétérogène et hybride
System Center 2012 R2 en environnement hétérogène et hybride
 
System Center 2012 R2 en environnement hétérogène et hybride
System Center 2012 R2 en environnement hétérogène et hybrideSystem Center 2012 R2 en environnement hétérogène et hybride
System Center 2012 R2 en environnement hétérogène et hybride
 
Administration intégrée HP/Microsoft des serveurs HP ProLiant
Administration intégrée HP/Microsoft des serveurs HP ProLiantAdministration intégrée HP/Microsoft des serveurs HP ProLiant
Administration intégrée HP/Microsoft des serveurs HP ProLiant
 
Au coeur du framework .net 4.5.1
Au coeur du framework .net 4.5.1Au coeur du framework .net 4.5.1
Au coeur du framework .net 4.5.1
 
System Center 2012 : Montez votre Cloud Privé avec NetApp et Cisco
System Center 2012 : Montez votre Cloud Privé avec NetApp et Cisco System Center 2012 : Montez votre Cloud Privé avec NetApp et Cisco
System Center 2012 : Montez votre Cloud Privé avec NetApp et Cisco
 
Au cœur du Framework .NET 4.5.1
Au cœur du Framework .NET 4.5.1Au cœur du Framework .NET 4.5.1
Au cœur du Framework .NET 4.5.1
 
[Scrum Day 2011] Outillage Agile dans un environnement Microsoft
[Scrum Day 2011] Outillage Agile dans un environnement Microsoft[Scrum Day 2011] Outillage Agile dans un environnement Microsoft
[Scrum Day 2011] Outillage Agile dans un environnement Microsoft
 
Cycle de vie d'un projet web agile avec TFS 2013, Azure VM et Monaco
Cycle de vie d'un projet web agile avec TFS 2013, Azure VM et MonacoCycle de vie d'un projet web agile avec TFS 2013, Azure VM et Monaco
Cycle de vie d'un projet web agile avec TFS 2013, Azure VM et Monaco
 
Retour d'expérience sur PowerShell
Retour d'expérience sur PowerShellRetour d'expérience sur PowerShell
Retour d'expérience sur PowerShell
 
Services de bureaux distants dans Windows Server 2012 R2 et Azure
Services de bureaux distants dans Windows Server 2012 R2 et AzureServices de bureaux distants dans Windows Server 2012 R2 et Azure
Services de bureaux distants dans Windows Server 2012 R2 et Azure
 
Symfony2 et Microsoft Azure, l’efficacité de PHP dans le cloud
Symfony2 et Microsoft Azure, l’efficacité de PHP dans le cloud Symfony2 et Microsoft Azure, l’efficacité de PHP dans le cloud
Symfony2 et Microsoft Azure, l’efficacité de PHP dans le cloud
 
_JCVFr
_JCVFr_JCVFr
_JCVFr
 
Les nouveautés de PowerShell 3.0
Les nouveautés de PowerShell 3.0Les nouveautés de PowerShell 3.0
Les nouveautés de PowerShell 3.0
 
Power shell saturday Paris 2017 Omiossec
Power shell saturday  Paris 2017 OmiossecPower shell saturday  Paris 2017 Omiossec
Power shell saturday Paris 2017 Omiossec
 
Tech daysRetour d’expérience Big Compute & HPC sur Windows Azure [TechDays 2014]
Tech daysRetour d’expérience Big Compute & HPC sur Windows Azure [TechDays 2014]Tech daysRetour d’expérience Big Compute & HPC sur Windows Azure [TechDays 2014]
Tech daysRetour d’expérience Big Compute & HPC sur Windows Azure [TechDays 2014]
 
Déploiment des tablettes et gestion du parc informatique dans les établisseme...
Déploiment des tablettes et gestion du parc informatique dans les établisseme...Déploiment des tablettes et gestion du parc informatique dans les établisseme...
Déploiment des tablettes et gestion du parc informatique dans les établisseme...
 

Mehr von Microsoft Technet France

Automatisez, visualisez et améliorez vos processus d’entreprise avec Nintex
Automatisez, visualisez et améliorez vos processus d’entreprise avec Nintex Automatisez, visualisez et améliorez vos processus d’entreprise avec Nintex
Automatisez, visualisez et améliorez vos processus d’entreprise avec Nintex Microsoft Technet France
 
Comment réussir votre déploiement de Windows 10
Comment réussir votre déploiement de Windows 10Comment réussir votre déploiement de Windows 10
Comment réussir votre déploiement de Windows 10Microsoft Technet France
 
Fusion, Acquisition - Optimisez la migration et la continuité des outils col...
 Fusion, Acquisition - Optimisez la migration et la continuité des outils col... Fusion, Acquisition - Optimisez la migration et la continuité des outils col...
Fusion, Acquisition - Optimisez la migration et la continuité des outils col...Microsoft Technet France
 
Wavestone déploie son portail Powell 365 en 5 semaines
Wavestone déploie son portail Powell 365 en 5 semainesWavestone déploie son portail Powell 365 en 5 semaines
Wavestone déploie son portail Powell 365 en 5 semainesMicrosoft Technet France
 
Retour d’expérience sur le monitoring et la sécurisation des identités Azure
Retour d’expérience sur le monitoring et la sécurisation des identités AzureRetour d’expérience sur le monitoring et la sécurisation des identités Azure
Retour d’expérience sur le monitoring et la sécurisation des identités AzureMicrosoft Technet France
 
Scénarios de mobilité couverts par Enterprise Mobility + Security
Scénarios de mobilité couverts par Enterprise Mobility + SecurityScénarios de mobilité couverts par Enterprise Mobility + Security
Scénarios de mobilité couverts par Enterprise Mobility + SecurityMicrosoft Technet France
 
SharePoint Framework : le développement SharePoint nouvelle génération
SharePoint Framework : le développement SharePoint nouvelle générationSharePoint Framework : le développement SharePoint nouvelle génération
SharePoint Framework : le développement SharePoint nouvelle générationMicrosoft Technet France
 
Stockage Cloud : il y en aura pour tout le monde
Stockage Cloud : il y en aura pour tout le mondeStockage Cloud : il y en aura pour tout le monde
Stockage Cloud : il y en aura pour tout le mondeMicrosoft Technet France
 
Bien appréhender le concept de Windows As a Service
Bien appréhender le concept de Windows As a ServiceBien appréhender le concept de Windows As a Service
Bien appréhender le concept de Windows As a ServiceMicrosoft Technet France
 
Protéger vos données avec le chiffrement dans Azure et Office 365
Protéger vos données avec le chiffrement dans Azure et Office 365Protéger vos données avec le chiffrement dans Azure et Office 365
Protéger vos données avec le chiffrement dans Azure et Office 365Microsoft Technet France
 
Protéger votre patrimoine informationnel dans un monde hybride avec Azure Inf...
Protéger votre patrimoine informationnel dans un monde hybride avec Azure Inf...Protéger votre patrimoine informationnel dans un monde hybride avec Azure Inf...
Protéger votre patrimoine informationnel dans un monde hybride avec Azure Inf...Microsoft Technet France
 
Comprendre la stratégie identité de Microsoft
Comprendre la stratégie identité de MicrosoftComprendre la stratégie identité de Microsoft
Comprendre la stratégie identité de MicrosoftMicrosoft Technet France
 
Vous avez dit « authentification sans mot de passe » : une illustration avec ...
Vous avez dit « authentification sans mot de passe » : une illustration avec ...Vous avez dit « authentification sans mot de passe » : une illustration avec ...
Vous avez dit « authentification sans mot de passe » : une illustration avec ...Microsoft Technet France
 
Déploiement hybride, la téléphonie dans le cloud
Déploiement hybride, la téléphonie dans le cloudDéploiement hybride, la téléphonie dans le cloud
Déploiement hybride, la téléphonie dans le cloudMicrosoft Technet France
 
Supervisez la qualité des appels Skype for Business Online à l'aide de Call Q...
Supervisez la qualité des appels Skype for Business Online à l'aide de Call Q...Supervisez la qualité des appels Skype for Business Online à l'aide de Call Q...
Supervisez la qualité des appels Skype for Business Online à l'aide de Call Q...Microsoft Technet France
 
SharePoint 2016 : architecture, déploiement et topologies hybrides
SharePoint 2016 : architecture, déploiement et topologies hybridesSharePoint 2016 : architecture, déploiement et topologies hybrides
SharePoint 2016 : architecture, déploiement et topologies hybridesMicrosoft Technet France
 
Gestion de Windows 10 et des applications dans l'entreprise moderne
Gestion de Windows 10 et des applications dans l'entreprise moderneGestion de Windows 10 et des applications dans l'entreprise moderne
Gestion de Windows 10 et des applications dans l'entreprise moderneMicrosoft Technet France
 
Office 365 dans votre Système d'Informations
Office 365 dans votre Système d'InformationsOffice 365 dans votre Système d'Informations
Office 365 dans votre Système d'InformationsMicrosoft Technet France
 

Mehr von Microsoft Technet France (20)

Automatisez, visualisez et améliorez vos processus d’entreprise avec Nintex
Automatisez, visualisez et améliorez vos processus d’entreprise avec Nintex Automatisez, visualisez et améliorez vos processus d’entreprise avec Nintex
Automatisez, visualisez et améliorez vos processus d’entreprise avec Nintex
 
Comment réussir votre déploiement de Windows 10
Comment réussir votre déploiement de Windows 10Comment réussir votre déploiement de Windows 10
Comment réussir votre déploiement de Windows 10
 
OMS log search au quotidien
OMS log search au quotidienOMS log search au quotidien
OMS log search au quotidien
 
Fusion, Acquisition - Optimisez la migration et la continuité des outils col...
 Fusion, Acquisition - Optimisez la migration et la continuité des outils col... Fusion, Acquisition - Optimisez la migration et la continuité des outils col...
Fusion, Acquisition - Optimisez la migration et la continuité des outils col...
 
Wavestone déploie son portail Powell 365 en 5 semaines
Wavestone déploie son portail Powell 365 en 5 semainesWavestone déploie son portail Powell 365 en 5 semaines
Wavestone déploie son portail Powell 365 en 5 semaines
 
Retour d’expérience sur le monitoring et la sécurisation des identités Azure
Retour d’expérience sur le monitoring et la sécurisation des identités AzureRetour d’expérience sur le monitoring et la sécurisation des identités Azure
Retour d’expérience sur le monitoring et la sécurisation des identités Azure
 
Scénarios de mobilité couverts par Enterprise Mobility + Security
Scénarios de mobilité couverts par Enterprise Mobility + SecurityScénarios de mobilité couverts par Enterprise Mobility + Security
Scénarios de mobilité couverts par Enterprise Mobility + Security
 
SharePoint Framework : le développement SharePoint nouvelle génération
SharePoint Framework : le développement SharePoint nouvelle générationSharePoint Framework : le développement SharePoint nouvelle génération
SharePoint Framework : le développement SharePoint nouvelle génération
 
Stockage Cloud : il y en aura pour tout le monde
Stockage Cloud : il y en aura pour tout le mondeStockage Cloud : il y en aura pour tout le monde
Stockage Cloud : il y en aura pour tout le monde
 
Bien appréhender le concept de Windows As a Service
Bien appréhender le concept de Windows As a ServiceBien appréhender le concept de Windows As a Service
Bien appréhender le concept de Windows As a Service
 
Protéger vos données avec le chiffrement dans Azure et Office 365
Protéger vos données avec le chiffrement dans Azure et Office 365Protéger vos données avec le chiffrement dans Azure et Office 365
Protéger vos données avec le chiffrement dans Azure et Office 365
 
Protéger votre patrimoine informationnel dans un monde hybride avec Azure Inf...
Protéger votre patrimoine informationnel dans un monde hybride avec Azure Inf...Protéger votre patrimoine informationnel dans un monde hybride avec Azure Inf...
Protéger votre patrimoine informationnel dans un monde hybride avec Azure Inf...
 
Comprendre la stratégie identité de Microsoft
Comprendre la stratégie identité de MicrosoftComprendre la stratégie identité de Microsoft
Comprendre la stratégie identité de Microsoft
 
Vous avez dit « authentification sans mot de passe » : une illustration avec ...
Vous avez dit « authentification sans mot de passe » : une illustration avec ...Vous avez dit « authentification sans mot de passe » : une illustration avec ...
Vous avez dit « authentification sans mot de passe » : une illustration avec ...
 
Sécurité des données
Sécurité des donnéesSécurité des données
Sécurité des données
 
Déploiement hybride, la téléphonie dans le cloud
Déploiement hybride, la téléphonie dans le cloudDéploiement hybride, la téléphonie dans le cloud
Déploiement hybride, la téléphonie dans le cloud
 
Supervisez la qualité des appels Skype for Business Online à l'aide de Call Q...
Supervisez la qualité des appels Skype for Business Online à l'aide de Call Q...Supervisez la qualité des appels Skype for Business Online à l'aide de Call Q...
Supervisez la qualité des appels Skype for Business Online à l'aide de Call Q...
 
SharePoint 2016 : architecture, déploiement et topologies hybrides
SharePoint 2016 : architecture, déploiement et topologies hybridesSharePoint 2016 : architecture, déploiement et topologies hybrides
SharePoint 2016 : architecture, déploiement et topologies hybrides
 
Gestion de Windows 10 et des applications dans l'entreprise moderne
Gestion de Windows 10 et des applications dans l'entreprise moderneGestion de Windows 10 et des applications dans l'entreprise moderne
Gestion de Windows 10 et des applications dans l'entreprise moderne
 
Office 365 dans votre Système d'Informations
Office 365 dans votre Système d'InformationsOffice 365 dans votre Système d'Informations
Office 365 dans votre Système d'Informations
 

Powershell et les techniques de remoting

  • 2. PowerShell et les techniques de remoting Carlo Mancini - MVP Powershell - STMicroElectronics Fabien Dibot - Ingénieur Systèmes - Vivalto Santé @fdibot - @sysadm2010 Infrastructure, communication & collaboration
  • 3. Donnez votre avis ! Depuis votre smartphone sur : http://notes.mstechdays.fr De nombreux lots à gagner toute les heures !!! Claviers, souris et jeux Microsoft… Merci de nous aider à améliorer les Techdays ! #mstechdays Infrastructure, communication & collaboration
  • 5. SOMMAIRE 1. 2. 3. 4. Un peu d’histoire WinRM Les Sessions Common Information Model #mstechdays Infrastructure, communication & collaboration
  • 6. UN PEU D’HISTOIRE #mstechdays Infrastructure, communication & collaboration
  • 7. PowerShell, deux constats et un peu d’histoire • Montée en puissance de: – Windows 7 (45% du marché) – Windows 8 (10%) • Microsoft 'big shift': de la GUI vers Powershell #mstechdays Infrastructure, communication & collaboration
  • 8. L’évolution de Powershell Remoting Avant Powershell Powershell 1.0 Powershell 2.0 Powershell 3.0 Remote Desktop Connection (RDP) Get-WMIObject -Computername Cmdlets CIM Get-CIMInstance Sysinternals PsTools • PsExec • PsList • PsFile Pas de paramètre –Credential Paramètre – ComputerName dans 35 cmdlets • Get-Process • Get-Service • Restart-Computer • Get-WinEvent Sessions robustes Remoting Remoting implicite Logiciel tiers Protocole DCOM/RPC Sessions deconnectées Windows PWA #mstechdays Infrastructure, communication & collaboration
  • 9. Powershell Remoting, sauce 1.0… ... c'était du bricolage... #mstechdays Infrastructure, communication & collaboration
  • 10. Le problème avec DCOM/RPC Get-WMIObject #mstechdays Infrastructure, communication & collaboration
  • 11. RPC/DCOM vs Parefeu • le parefeu gagne... #mstechdays Infrastructure, communication & collaboration
  • 12. Le nouveau paradigme • Exploite le service WinRM – WinRM 1.0 • installé par défaut sur Vista • Ports 80 et 443 – WinRM 1.1 • sur Vista SP1 et 2008 SP1 • installable sur XP SP2, 2003 et 2003 R2 – WinRM 2.0 • sur Seven et sur 2008 R2 • Installable sur XP SP3, Vista (SP1 ou SP2), et 2008 (SP1 ou SP2) • Ports 5985 (http) et 5986 (https) • Introduit la notion de Session Infrastructure, communication & collaboration #mstechdays
  • 14. WinRM • Windows Remote Management • Basé sur le standard WS-Man (Web Services for Management) • S’appuie sur SOAP • Firewall-friendly #mstechdays Infrastructure, communication & collaboration
  • 15. Architecture et EndPoints Powershell.exe Serveur distant Powershell.exe ....exe Endpoint Powershell 64-bit Endpoint Powershell 32-bit Autre Endpoint Service WinRM http listener WS-MAN Station de travail #mstechdays Infrastructure, communication & collaboration
  • 16. WinRM et la sécurité Communication chiffrée entre les machines : • Utilisation des jetons Kerberos. • NTLM Pour lancer des scripts et/ou cmdlets: • Utilisateur membre du groupe Administrateurs local • Fournir des credentials Administrateur • Accéder à la configuration de la session PowerShell • Sessions paramétrables & collaboration #mstechdays Infrastructure, communication
  • 17. Installation de WinRM • WinRM Quickconfig #mstechdays Infrastructure, communication & collaboration
  • 18. Installation de WinRM • Enable PSRemoting #mstechdays Infrastructure, communication & collaboration
  • 19. Installation de WinRM • GPO – – – – – #mstechdays Computer Configuration Administrative Templates Windows Components Windows Remote Management WinRM Service Infrastructure, communication & collaboration
  • 20. Vérifications • Vérifier la connexion localement: – winrm quickconfig – Enter-PSSession -ComputerName localhost #mstechdays Infrastructure, communication & collaboration
  • 21. Configuration 1/4 • Voir votre configuration : – winrm get winrm/config – winrm enumerate winrm/config/listener – ls WSMan:localhostShell #mstechdays Infrastructure, communication & collaboration
  • 25. WinRM.. Des limitations…. Par défaut: • 30 sessions par utilisateur et par machine • 10 utilisateurs • 25 cmdlets simultanées, le reste en queue • 1024MB assigné par session #mstechdays Infrastructure, communication & collaboration
  • 28. Modèles de Remoting • Fan-Out, 1-to-many • 1-to-1, SSH-style #mstechdays Infrastructure, communication & collaboration
  • 30. Invoke-Command et les objets désérialisés • On peut travailler avec la sortie de commande de quasiment la même manière que toute autre sortie de commande #mstechdays Infrastructure, communication & collaboration
  • 31. Invoke-Command mais pas de méthodes • Les objets désérialisés que notre station reçoit sur le pipeline ne sont qu'un snapshot de l'objet original #mstechdays Infrastructure, communication & collaboration
  • 32. Invoke-Command et Select-Object • La sérialisation et désérialisation des données a un coût très fort en terme de paquets envoyés sur le réseau • Bonne pratique: utiliser Select-Object sur l'objet distant optimise l'envoi des données sur le réseau #mstechdays Infrastructure, communication & collaboration
  • 33. Invoke-Command sans erreur • Invoke-Command est sujet aux erreurs de frappe • On peut utiliser des scripts .ps1 • Paramètre -FilePath Invoke-Command ` -ComputerName vm2008R25,vm2008R26 ` -FilePath C:MyScript.ps1 #mstechdays Infrastructure, communication & collaboration
  • 34. Le paramètre -AsJob • Invoke-Command peut être utilisé avec le paramètre –AsJob – la commande est exécutée de façon asynchrone en arrière-plan – l’invite Windows PowerShell est immédiatement retourné #mstechdays Infrastructure, communication & collaboration
  • 36. Exemple de session interactive temporaire #mstechdays Infrastructure, communication & collaboration
  • 37. Sessions distantes persistantes • Les sessions temporaires ne sont pas efficientes – Overhead à l'initialization de chaque session – Overhead pour le tear-down de chaque session • L’alternative: New-PSSession – pour démarrer une nouvelle session persistante • Get-PSSession –ComputerName – pour voir une session existante #mstechdays Infrastructure, communication & collaboration
  • 38. La variable $Session • … ou comment faire du Invoke-Command sur une session persistante #mstechdays Infrastructure, communication & collaboration
  • 39. Rajouter une nouvelle session #mstechdays Infrastructure, communication & collaboration
  • 40. Interagir avec une session persistante • Enter-PSSession accepte le paramètre -Session – La commande Exit-PSSession ne supprime pas la session #mstechdays Infrastructure, communication & collaboration
  • 41. Sessions déconnectées • Nouveauté dans Powershell 3.0 • Connect-PSSession et DisconnectPSSession • La reconnexion peut se faire: – du poste client où la session a été créée – à partir d'un autre poste (mais toujours avec le même compte) – Powershell 3.0/4.0 installé des deux #mstechdays Infrastructure, communication & collaboration
  • 42. Exemples de sessions déconnectées #mstechdays Infrastructure, communication & collaboration
  • 43. Invoke-Command et les sessions persistantes • Paramètre -InDisconnectedSession – depuis Powershell 3.0 permet à Invoke-Command de profiter de la flexibilité et robustesse des sessions déconnectées – la session est crée, la commande exécutée et la session est fermée avant qu'une sortie soit produite #mstechdays Infrastructure, communication & collaboration
  • 44. Détruire une session persistante • Remove-PSSession #mstechdays Infrastructure, communication & collaboration
  • 45. Implicit Remoting • Pas de module sur votre station de travail ? • Pas envie d'installer RSAT ? • Import-PSSession – importe des cmdlets à partir d'une session PSSession d'un ordinateur local ou distant dans la session active. #mstechdays Infrastructure, communication & collaboration
  • 46. Exemple de Implicit Remoting #mstechdays Infrastructure, communication & collaboration
  • 48. Un peu d’histoire… • WMI intégré à tous les OS Microsoft. • WMI construit sur la base WBEM et CIM de la DMTF • CIM permet une interface commune pour le management: – OS Windows et Linux – Equipements réseaux – Solution de virtualisation • PowerShell 1 et 2 -> WMI et accélérateurs • PowerShell 3 et 4 ->communication & collaboration Module CIMCmdlets #mstechdays Infrastructure,
  • 49. Les CMDLets CIM #mstechdays Infrastructure, communication & collaboration
  • 50. Créer une session #mstechdays Infrastructure, communication & collaboration
  • 51. Session avec options #mstechdays Infrastructure, communication & collaboration
  • 53. Exécuter une méthode #mstechdays Infrastructure, communication & collaboration
  • 54. Limitations • Plus limité que WMI, actuellement: – Impossibilité de passer le paramètre credential sans créer une session – Certaines Classes WMI sont manquantes – Impossibilité d’appeler des Objets/Méthodes .NET #mstechdays Infrastructure, communication & collaboration
  • 55. DES QUESTIONS ? #mstechdays Infrastructure, communication & collaboration
  • 56. Pour aller plus loin… http://aka.ms/MVA Offre spéciale TechDays limitée aux 200 premières demandes, 1 pack par individu http://aka.ms/jeveuxwindows2012 Approfondissez Microsoft System Center 2012 Agenda des séminaires techniques pour les IT Pros : http://aka.ms/itcamps-france Agenda des séminaires fonctionnels pour les décideurs : http://aka.ms/TDI #mstechdays http://aka.ms/jeveuxmoncloudprive http://aka.ms/free/trial Infrastructure, communication & collaboration
  • 57. RESSOURCES • • • • • • • • • • http://powershell-scripting.com – FR http://lazywinadmin.com - US http://learn-powershell.net – US http://powershell.org – US http://via-powershell.fr - FR http://shellyourexperience.com - US http://my-powershell.fr - FR http://jdhitsolutions.com/blog -US http://happysysadm.com – US http://pwrshell.net – FR #mstechdays Infrastructure, communication & collaboration