SlideShare une entreprise Scribd logo
1  sur  19
Introduction to PowerShell Remoting, Part 2 Matt Johnson, GSEC, MCSE matt@michiganpowershell.com
What are we going to cover? Remote Commands Reusable  Sessions with PS Remoting Interactive Sessions with PS Remoting Temporary Sessions with PS Remoting
Remote Commands New-PSSession Get-PSSession Enter-PSSession Exit-PSSession Remove-PSSession Invoke-Command
PS Remoting Help Get-Help  about_Remoting about_PSSessions about_Remote_Requirements about_Remote_FAQ about_Remote_Troubleshooting
Reusable  Sessions with PS Remoting It is really easy to create  a new PS Session $dc = New-PSSession –computerName DC1 It is also really easy to enter that session Enter-PSSession –Session $dc More about that later!
Reusable  Sessions with PS Remoting Cont.. Less network / CPU cycles used when using Reusable sessions compared to running individual commands. You can run one off commands if you are using Reusable sessions Use Reusable sessions when you need to run more than one command against a computer.
Demo
Running Commands against muliple machines $sessions = New-PSSession pc1, pc2, pc3 Invoke-Command { Md HKLM:oftwarewjcomputing  } –Session $sessions
Passing Variables to Remote Hosts You can pass variables to the Invoke-Command cmdlet Your script block must use the param statement Use the –ArgumentList switch
Demo
Interactive Sessions Run at a console just like you are sitting there at the machine.  Run all normal PowerShell commands You can restrict the commands that can be run remotely.
Demo
Code to change what is allowed to run # Disable access to all applications $ExecutionContext.SessionState.Applications.Clear() # Disable access to scripts $ExecutionContext.SessionState.Scripts.Clear() # Define a list of allowed commands $RequiredCommands = "Exit-PSSession", "Get-Command", "Get-FormatData", "Get-Help", "Measure-Object", "Out-Default", "Select-Object" $Commands = $RequiredCommands + "Get-Process", "Get-Service", "Where-Object", "ForEach-Object" # Make everything except the allowed commands private (not visible) Get-Command | Where-Object {$Commands -notcontains $_.Name} | ForEach-Object {$_.Visibility="Private"} # Restrict the language elements to a very limited set. The possible values are FullLanguage,RestrictedLanguage, and NoLanguage $ExecutionContext.SessionState.LanguageMode="RestrictedLanguage"
Code to change what is allowed to run cont. Save as: %windir%ystem32indowsPowerShell1.0estricted.ps1
Running single commands Use Invoke-Command Results are returned as text, not as objects Adds some overhead by doing it this way
DEMo
Remoting Resources Two very useful resources! Get-Help PowerShell.com’s Administrators Guide to PowerShell Remoting
Contact Matt Johnson Phone: +1 (734) 931-0323 Web: http://www.mwjcomputing.com/ Blog: http://www.mwjcomputing.com/blog/ Twitter: http://twitter.com/mwjcomputing Email: matt@michiganpowershell.com
Thanks!

Contenu connexe

Tendances

NSClient++ Workshop: 06 Scripting
NSClient++ Workshop: 06 ScriptingNSClient++ Workshop: 06 Scripting
NSClient++ Workshop: 06 ScriptingMichael Medin
 
Replica Sets (NYC NoSQL Meetup)
Replica Sets (NYC NoSQL Meetup)Replica Sets (NYC NoSQL Meetup)
Replica Sets (NYC NoSQL Meetup)MongoDB
 
Configuration of BIND DNS Server On CentOS 8
Configuration of BIND DNS Server On CentOS 8Configuration of BIND DNS Server On CentOS 8
Configuration of BIND DNS Server On CentOS 8Kaan Aslandağ
 
Zimbra Troubleshooting - Mails not being Delivered or Deferred or Connection ...
Zimbra Troubleshooting - Mails not being Delivered or Deferred or Connection ...Zimbra Troubleshooting - Mails not being Delivered or Deferred or Connection ...
Zimbra Troubleshooting - Mails not being Delivered or Deferred or Connection ...VCP Muthukrishna
 
Configuration Firewalld On CentOS 8
Configuration Firewalld On CentOS 8Configuration Firewalld On CentOS 8
Configuration Firewalld On CentOS 8Kaan Aslandağ
 
How to Fix Duplicate Packages in YUM on CentOS 7
How to Fix Duplicate Packages in YUM on CentOS 7How to Fix Duplicate Packages in YUM on CentOS 7
How to Fix Duplicate Packages in YUM on CentOS 7VCP Muthukrishna
 
Talk about Ansible and Infrastructure as Code
Talk about Ansible and Infrastructure as CodeTalk about Ansible and Infrastructure as Code
Talk about Ansible and Infrastructure as CodeSATOSHI TAGOMORI
 
Deploying systemd at scale
Deploying systemd at scaleDeploying systemd at scale
Deploying systemd at scaleDavide Cavalca
 
How To Configure Nginx Load Balancer on CentOS 7
How To Configure Nginx Load Balancer on CentOS 7How To Configure Nginx Load Balancer on CentOS 7
How To Configure Nginx Load Balancer on CentOS 7VCP Muthukrishna
 
How To Install and Configure Screen on CentOS 7
How To Install and Configure Screen on CentOS 7How To Install and Configure Screen on CentOS 7
How To Install and Configure Screen on CentOS 7VCP Muthukrishna
 
Configuration of NTP Server on CentOS 8
Configuration of NTP Server on CentOS 8Configuration of NTP Server on CentOS 8
Configuration of NTP Server on CentOS 8Kaan Aslandağ
 
Presentation Linux Server setup Advance Networking
Presentation   Linux Server setup Advance NetworkingPresentation   Linux Server setup Advance Networking
Presentation Linux Server setup Advance NetworkingTariqul Islam Shohag
 
OSDC 2014: Jan-Piet Mens - Configuration Management with Ansible
OSDC 2014: Jan-Piet Mens - Configuration Management with Ansible OSDC 2014: Jan-Piet Mens - Configuration Management with Ansible
OSDC 2014: Jan-Piet Mens - Configuration Management with Ansible NETWAYS
 
Advanced Replication
Advanced ReplicationAdvanced Replication
Advanced ReplicationMongoDB
 
Install and Configure RSyslog – CentOS 7 / RHEL 7
Install and Configure RSyslog – CentOS 7 / RHEL 7Install and Configure RSyslog – CentOS 7 / RHEL 7
Install and Configure RSyslog – CentOS 7 / RHEL 7VCP Muthukrishna
 
How To Manage Linux User on RHEL 7
How To Manage Linux User on RHEL 7How To Manage Linux User on RHEL 7
How To Manage Linux User on RHEL 7VCP Muthukrishna
 

Tendances (20)

NSClient++ Workshop: 06 Scripting
NSClient++ Workshop: 06 ScriptingNSClient++ Workshop: 06 Scripting
NSClient++ Workshop: 06 Scripting
 
Replica Sets (NYC NoSQL Meetup)
Replica Sets (NYC NoSQL Meetup)Replica Sets (NYC NoSQL Meetup)
Replica Sets (NYC NoSQL Meetup)
 
Configuration of BIND DNS Server On CentOS 8
Configuration of BIND DNS Server On CentOS 8Configuration of BIND DNS Server On CentOS 8
Configuration of BIND DNS Server On CentOS 8
 
Zimbra Troubleshooting - Mails not being Delivered or Deferred or Connection ...
Zimbra Troubleshooting - Mails not being Delivered or Deferred or Connection ...Zimbra Troubleshooting - Mails not being Delivered or Deferred or Connection ...
Zimbra Troubleshooting - Mails not being Delivered or Deferred or Connection ...
 
Configuration Firewalld On CentOS 8
Configuration Firewalld On CentOS 8Configuration Firewalld On CentOS 8
Configuration Firewalld On CentOS 8
 
Install PostgreSQL on CentOS
Install PostgreSQL on CentOSInstall PostgreSQL on CentOS
Install PostgreSQL on CentOS
 
Plesk CLI Wrapper
Plesk CLI WrapperPlesk CLI Wrapper
Plesk CLI Wrapper
 
How to Fix Duplicate Packages in YUM on CentOS 7
How to Fix Duplicate Packages in YUM on CentOS 7How to Fix Duplicate Packages in YUM on CentOS 7
How to Fix Duplicate Packages in YUM on CentOS 7
 
Talk about Ansible and Infrastructure as Code
Talk about Ansible and Infrastructure as CodeTalk about Ansible and Infrastructure as Code
Talk about Ansible and Infrastructure as Code
 
Deploying systemd at scale
Deploying systemd at scaleDeploying systemd at scale
Deploying systemd at scale
 
How To Configure Nginx Load Balancer on CentOS 7
How To Configure Nginx Load Balancer on CentOS 7How To Configure Nginx Load Balancer on CentOS 7
How To Configure Nginx Load Balancer on CentOS 7
 
How To Install and Configure Screen on CentOS 7
How To Install and Configure Screen on CentOS 7How To Install and Configure Screen on CentOS 7
How To Install and Configure Screen on CentOS 7
 
Firewalld LAB
Firewalld LABFirewalld LAB
Firewalld LAB
 
Configuration of NTP Server on CentOS 8
Configuration of NTP Server on CentOS 8Configuration of NTP Server on CentOS 8
Configuration of NTP Server on CentOS 8
 
Presentation Linux Server setup Advance Networking
Presentation   Linux Server setup Advance NetworkingPresentation   Linux Server setup Advance Networking
Presentation Linux Server setup Advance Networking
 
OSDC 2014: Jan-Piet Mens - Configuration Management with Ansible
OSDC 2014: Jan-Piet Mens - Configuration Management with Ansible OSDC 2014: Jan-Piet Mens - Configuration Management with Ansible
OSDC 2014: Jan-Piet Mens - Configuration Management with Ansible
 
GCP Deployment Manager Demo
GCP Deployment Manager DemoGCP Deployment Manager Demo
GCP Deployment Manager Demo
 
Advanced Replication
Advanced ReplicationAdvanced Replication
Advanced Replication
 
Install and Configure RSyslog – CentOS 7 / RHEL 7
Install and Configure RSyslog – CentOS 7 / RHEL 7Install and Configure RSyslog – CentOS 7 / RHEL 7
Install and Configure RSyslog – CentOS 7 / RHEL 7
 
How To Manage Linux User on RHEL 7
How To Manage Linux User on RHEL 7How To Manage Linux User on RHEL 7
How To Manage Linux User on RHEL 7
 

En vedette

Edisi 31 Okt Aceh
Edisi 31 Okt AcehEdisi 31 Okt Aceh
Edisi 31 Okt Acehepaper
 
Edisi 9 Medan
Edisi 9 MedanEdisi 9 Medan
Edisi 9 Medanepaper
 
Bab 9 Pembangunan Sumber Manusia
Bab 9 Pembangunan Sumber ManusiaBab 9 Pembangunan Sumber Manusia
Bab 9 Pembangunan Sumber Manusiazafeen zafeen
 
Edisi 10 April Nas
Edisi 10 April NasEdisi 10 April Nas
Edisi 10 April Nasepaper
 
Meeting with Investors - May 2015
Meeting with Investors - May 2015Meeting with Investors - May 2015
Meeting with Investors - May 2015TIM RI
 
2010 Shift Happened Vujade
2010 Shift Happened Vujade2010 Shift Happened Vujade
2010 Shift Happened VujadeVujàdé
 
Wie snackt in foodservice meer mof v
Wie snackt in foodservice meer mof vWie snackt in foodservice meer mof v
Wie snackt in foodservice meer mof vRien De Koning
 
Ch 1 mexico city
Ch 1 mexico cityCh 1 mexico city
Ch 1 mexico citypotasz
 
7jun nas
7jun nas7jun nas
7jun nasepaper
 
14jun nas
14jun nas14jun nas
14jun nasepaper
 
Industrial Plan 2016 2018
Industrial Plan 2016 2018Industrial Plan 2016 2018
Industrial Plan 2016 2018TIM RI
 
What's so special about christmas
What's so special about christmasWhat's so special about christmas
What's so special about christmasEhab Roufail
 
Taqwim smk landas 2011
Taqwim smk landas 2011Taqwim smk landas 2011
Taqwim smk landas 2011zafeen zafeen
 
MVC 3-RAZOR Validation
MVC 3-RAZOR ValidationMVC 3-RAZOR Validation
MVC 3-RAZOR ValidationKrunal Trivedi
 

En vedette (20)

Edisi 31 Okt Aceh
Edisi 31 Okt AcehEdisi 31 Okt Aceh
Edisi 31 Okt Aceh
 
Edisi 9 Medan
Edisi 9 MedanEdisi 9 Medan
Edisi 9 Medan
 
Bab 9 Pembangunan Sumber Manusia
Bab 9 Pembangunan Sumber ManusiaBab 9 Pembangunan Sumber Manusia
Bab 9 Pembangunan Sumber Manusia
 
Edisi 10 April Nas
Edisi 10 April NasEdisi 10 April Nas
Edisi 10 April Nas
 
Meeting with Investors - May 2015
Meeting with Investors - May 2015Meeting with Investors - May 2015
Meeting with Investors - May 2015
 
2010 Shift Happened Vujade
2010 Shift Happened Vujade2010 Shift Happened Vujade
2010 Shift Happened Vujade
 
Tnt
TntTnt
Tnt
 
Wie snackt in foodservice meer mof v
Wie snackt in foodservice meer mof vWie snackt in foodservice meer mof v
Wie snackt in foodservice meer mof v
 
Ch 1 mexico city
Ch 1 mexico cityCh 1 mexico city
Ch 1 mexico city
 
Stand Out in a Crowd
Stand Out in a CrowdStand Out in a Crowd
Stand Out in a Crowd
 
Tata group presentation
Tata group presentationTata group presentation
Tata group presentation
 
7jun nas
7jun nas7jun nas
7jun nas
 
14jun nas
14jun nas14jun nas
14jun nas
 
Industrial Plan 2016 2018
Industrial Plan 2016 2018Industrial Plan 2016 2018
Industrial Plan 2016 2018
 
What's so special about christmas
What's so special about christmasWhat's so special about christmas
What's so special about christmas
 
Airport Noise Presentation 2009
Airport Noise Presentation 2009Airport Noise Presentation 2009
Airport Noise Presentation 2009
 
WED- Gift Basket
WED- Gift BasketWED- Gift Basket
WED- Gift Basket
 
Park Plantings
Park PlantingsPark Plantings
Park Plantings
 
Taqwim smk landas 2011
Taqwim smk landas 2011Taqwim smk landas 2011
Taqwim smk landas 2011
 
MVC 3-RAZOR Validation
MVC 3-RAZOR ValidationMVC 3-RAZOR Validation
MVC 3-RAZOR Validation
 

Similaire à April 2010-intro-to-remoting-part2

Managing enterprise with PowerShell remoting
Managing enterprise with PowerShell remotingManaging enterprise with PowerShell remoting
Managing enterprise with PowerShell remotingConcentrated Technology
 
PowerShell for SharePoint Developers
PowerShell for SharePoint DevelopersPowerShell for SharePoint Developers
PowerShell for SharePoint DevelopersBoulos Dib
 
Introduction to PowerShell
Introduction to PowerShellIntroduction to PowerShell
Introduction to PowerShellBoulos Dib
 
Learn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdf
Learn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdfLearn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdf
Learn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdfClapperboardCinemaPV
 
Get-Help: An intro to PowerShell and how to Use it for Evil
Get-Help: An intro to PowerShell and how to Use it for EvilGet-Help: An intro to PowerShell and how to Use it for Evil
Get-Help: An intro to PowerShell and how to Use it for Eviljaredhaight
 
Automating Active Directory mgmt in PowerShell
Automating Active Directory mgmt in PowerShellAutomating Active Directory mgmt in PowerShell
Automating Active Directory mgmt in PowerShellConcentrated Technology
 
Session Server - Maintaing State between several Servers
Session Server - Maintaing State between several ServersSession Server - Maintaing State between several Servers
Session Server - Maintaing State between several ServersStephan Schmidt
 
Power shell training
Power shell trainingPower shell training
Power shell trainingDavid Brabant
 
Basic commands for powershell : Configuring Windows PowerShell and working wi...
Basic commands for powershell : Configuring Windows PowerShell and working wi...Basic commands for powershell : Configuring Windows PowerShell and working wi...
Basic commands for powershell : Configuring Windows PowerShell and working wi...Hitesh Mohapatra
 
Course 102: Lecture 8: Composite Commands
Course 102: Lecture 8: Composite Commands Course 102: Lecture 8: Composite Commands
Course 102: Lecture 8: Composite Commands Ahmed El-Arabawy
 
PM : code faster
PM : code fasterPM : code faster
PM : code fasterPHPPRO
 
Windows power shell basics
Windows power shell basicsWindows power shell basics
Windows power shell basicsDan Morrill
 
Power shell for sp admins
Power shell for sp adminsPower shell for sp admins
Power shell for sp adminsRick Taylor
 

Similaire à April 2010-intro-to-remoting-part2 (20)

PowerShell Remoting
PowerShell RemotingPowerShell Remoting
PowerShell Remoting
 
PowerShell 2.0 remoting
PowerShell 2.0 remotingPowerShell 2.0 remoting
PowerShell 2.0 remoting
 
Managing enterprise with PowerShell remoting
Managing enterprise with PowerShell remotingManaging enterprise with PowerShell remoting
Managing enterprise with PowerShell remoting
 
PowerShell - PowerForensics
PowerShell - PowerForensicsPowerShell - PowerForensics
PowerShell - PowerForensics
 
PowerShell for SharePoint Developers
PowerShell for SharePoint DevelopersPowerShell for SharePoint Developers
PowerShell for SharePoint Developers
 
Introduction to PowerShell
Introduction to PowerShellIntroduction to PowerShell
Introduction to PowerShell
 
Learn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdf
Learn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdfLearn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdf
Learn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdf
 
Get-Help: An intro to PowerShell and how to Use it for Evil
Get-Help: An intro to PowerShell and how to Use it for EvilGet-Help: An intro to PowerShell and how to Use it for Evil
Get-Help: An intro to PowerShell and how to Use it for Evil
 
Automating Active Directory mgmt in PowerShell
Automating Active Directory mgmt in PowerShellAutomating Active Directory mgmt in PowerShell
Automating Active Directory mgmt in PowerShell
 
The Power of PowerShell: Advanced
The Power of PowerShell: Advanced The Power of PowerShell: Advanced
The Power of PowerShell: Advanced
 
Windows PowerShell
Windows PowerShellWindows PowerShell
Windows PowerShell
 
Session Server - Maintaing State between several Servers
Session Server - Maintaing State between several ServersSession Server - Maintaing State between several Servers
Session Server - Maintaing State between several Servers
 
Power shell training
Power shell trainingPower shell training
Power shell training
 
Automazione quotidiana in php
Automazione quotidiana in phpAutomazione quotidiana in php
Automazione quotidiana in php
 
Basic commands for powershell : Configuring Windows PowerShell and working wi...
Basic commands for powershell : Configuring Windows PowerShell and working wi...Basic commands for powershell : Configuring Windows PowerShell and working wi...
Basic commands for powershell : Configuring Windows PowerShell and working wi...
 
Course 102: Lecture 8: Composite Commands
Course 102: Lecture 8: Composite Commands Course 102: Lecture 8: Composite Commands
Course 102: Lecture 8: Composite Commands
 
Php101
Php101Php101
Php101
 
PM : code faster
PM : code fasterPM : code faster
PM : code faster
 
Windows power shell basics
Windows power shell basicsWindows power shell basics
Windows power shell basics
 
Power shell for sp admins
Power shell for sp adminsPower shell for sp admins
Power shell for sp admins
 

Dernier

Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 

Dernier (20)

Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 

April 2010-intro-to-remoting-part2

  • 1. Introduction to PowerShell Remoting, Part 2 Matt Johnson, GSEC, MCSE matt@michiganpowershell.com
  • 2. What are we going to cover? Remote Commands Reusable Sessions with PS Remoting Interactive Sessions with PS Remoting Temporary Sessions with PS Remoting
  • 3. Remote Commands New-PSSession Get-PSSession Enter-PSSession Exit-PSSession Remove-PSSession Invoke-Command
  • 4. PS Remoting Help Get-Help about_Remoting about_PSSessions about_Remote_Requirements about_Remote_FAQ about_Remote_Troubleshooting
  • 5. Reusable Sessions with PS Remoting It is really easy to create a new PS Session $dc = New-PSSession –computerName DC1 It is also really easy to enter that session Enter-PSSession –Session $dc More about that later!
  • 6. Reusable Sessions with PS Remoting Cont.. Less network / CPU cycles used when using Reusable sessions compared to running individual commands. You can run one off commands if you are using Reusable sessions Use Reusable sessions when you need to run more than one command against a computer.
  • 8. Running Commands against muliple machines $sessions = New-PSSession pc1, pc2, pc3 Invoke-Command { Md HKLM:oftwarewjcomputing } –Session $sessions
  • 9. Passing Variables to Remote Hosts You can pass variables to the Invoke-Command cmdlet Your script block must use the param statement Use the –ArgumentList switch
  • 10. Demo
  • 11. Interactive Sessions Run at a console just like you are sitting there at the machine. Run all normal PowerShell commands You can restrict the commands that can be run remotely.
  • 12. Demo
  • 13. Code to change what is allowed to run # Disable access to all applications $ExecutionContext.SessionState.Applications.Clear() # Disable access to scripts $ExecutionContext.SessionState.Scripts.Clear() # Define a list of allowed commands $RequiredCommands = "Exit-PSSession", "Get-Command", "Get-FormatData", "Get-Help", "Measure-Object", "Out-Default", "Select-Object" $Commands = $RequiredCommands + "Get-Process", "Get-Service", "Where-Object", "ForEach-Object" # Make everything except the allowed commands private (not visible) Get-Command | Where-Object {$Commands -notcontains $_.Name} | ForEach-Object {$_.Visibility="Private"} # Restrict the language elements to a very limited set. The possible values are FullLanguage,RestrictedLanguage, and NoLanguage $ExecutionContext.SessionState.LanguageMode="RestrictedLanguage"
  • 14. Code to change what is allowed to run cont. Save as: %windir%ystem32indowsPowerShell1.0estricted.ps1
  • 15. Running single commands Use Invoke-Command Results are returned as text, not as objects Adds some overhead by doing it this way
  • 16. DEMo
  • 17. Remoting Resources Two very useful resources! Get-Help PowerShell.com’s Administrators Guide to PowerShell Remoting
  • 18. Contact Matt Johnson Phone: +1 (734) 931-0323 Web: http://www.mwjcomputing.com/ Blog: http://www.mwjcomputing.com/blog/ Twitter: http://twitter.com/mwjcomputing Email: matt@michiganpowershell.com