SlideShare une entreprise Scribd logo
1  sur  29
Windows PowerShellCrash Course forSharePoint Administrators Don JonesConcentrated Technology, LLChttp://concentratedtech.com
This slide deck was used in one of our many conference presentations. We hope you enjoy it, and invite you to use it within your own organization however you like. For more information on our company, including information on private classes and upcoming conference appearances, please visit our Web site, www.ConcentratedTech.com.  For links to newly-posted decks, follow us on Twitter:@concentrateddon or @concentratdgreg This work is copyright ©Concentrated Technology, LLC
CAUTION: DEMOS AHEAD This is a demonstration-intensive session (very few slides) I will capture a shell transcript and save all of my scripts You can download these (in a week or so) from ConcentratedTech.com (there’s a “Conference Materials” link in the menu)
Welcome to the Shell Why did Microsoft write PowerShell? Is this a replacement for Cmd.exe or VBScript? How much “scripting” do I need to learn? How long will PowerShell be around? What versions of Windows does it work with? What MS products are PowerShell-ed?
Command Quiz Change directories Make a directory Get a list of files and folders Display contents of a text file Move a file Copy a file Delete a file
Running Commands Run all the commands you’re used to, with almost exactly the same syntax (Ping, Ipconfig, etc) New “cmdlets” have a more consistent naming convention and more consistent parameters… but they’re just commands Use Help to read more; add –full or –examples for even more help; use wildcards to discover more commands and help topics
One Set of Commands The file system is a hierarchical data store What other data stores does Windows use? Why not treat them as “disk drives” so that you can use the same set of commands?
Extending the Shell PSSnapins (the old way) Get-PSSnapin –registered Add-PSSnapinname Get-Command –pssnapinname Modules (the new way) Get-Module –listavailable Import-Module name Get-Command –module name There’s only one shell – the “pre-made shells” are just pre-loading a snap-in or module for you
Piping Just like Dir | More Export-, Out-, Format-, ConvertTo- are all useful verbs for piping Tip: Format- cmdlets go at the end of the pipeline. What they produce is only useful to Out-File, Out-Printer, Out-Host.
Output Run Get-Process See the resulting table? The real table, in memory, is much bigger – PowerShell just doesn’t show it Pipe the table to Get-Member to see other available columns Or pipe it to Format-List * (since a list can hold more data than a table) You don’t have to pipe stuff to a file and then grep it; you can simply refer to columns by name
More Piping Sorting: Sort-Object (or “Sort”) Filtering: Where-Object (or “Where”) Grouping: Group-Object (or “Group”) Measuring: Measure-Object (or “Measure”) Use Format- cmdlets to specify the columns (called “properties”) that you’d prefer to see
Phys Ed Let’s see the pipeline work in real life. Volunteers needed. You may win a prize.
How Pipeline input works Get-Service generates what type of table (ok, these are really “objects” and not a “table in memory,” but it’s all just words) Get-Service | Get-Member So when you runGet-Service | Stop-Servicehow does Stop-Service know what to do with what you piped in?
Pipeline Input ByValue Look at the parameters of Stop-Service Do any of them accept pipeline input ByValue and accept the type of data being produced by Stop-Service?
Now Consider This “BITS”,”w32time” | Stop-Service Those are strings“BITS” | Get-Member Does Stop-Service accept anything of the type String ByValue from the pipeline? This would work too:Get-Content names.txt | Stop-Service World this work?Get-Process | Stop-ServiceHmmm…
Pipeline Input ByPropertyName If nothing will work ByValue, then the shell tries to match up input columns with parameter names ByPropertyName Let’s look atGet-Process | Get-Member Do any of those column names match up with parameter names of Stop-Service? Do the matching parameter names accept input from the pipeline ByPropertyName?
Debugging Pipeline Input Trace-Command-Name PipelineBinding-PSHost-expression { Get-Process | Stop-Service }
Fun trick! Import user info from a CSV and make new users out of them
Workarounds What about when pipelining won’t work? Get-WmiObject-class Win32_BIOS-computername (type names.txt) Get-WmiObject-class Win32_BIOS-computername (	Get-ADComputer –filter * |	Select –expand Name)
Remote Control Requires PSH v2 Run Enable-PSRemoting to enable(or via GPO) on machines that will accept incoming connections Communicates over HTTP(s); authenticates with Kerberos Help about_remote* for more help
1:1, 1:n Remoting Enter-PSSession –computernamexExit-PSSession Invoke-Command-scriptblock { command(s) }-computernamex,x,x,x Notes: PSComputerName property FilePath switch to do a whole script
More Options -credential -port -useSSL Etc Or create a persistent session using New-PSSession. Get the sessions with Get-PSSessionInvoke-Command –scr { whatever }-session (Get-PSSession)
Implicit Remoting Start a session (maybe save it in a $variable for ease of referring to it) Import a module in the remote session Import the remote session into the local shell – just the commands from that module, and add a noun prefix Execute remote commands as if they were local!
WMI Get-WmiObject-class whatever (e.g., “Win32_XXX”)-computername x,y,z-EA SilentlyContinue (why?)-Filter ”something” (why?) Let’s play with that…
Awesome Advanced Trick Format-Table can accept a special item called a hashtable or dictionary as a property in a property list The dictionary must contain two items N: The name of the column you want to create E: The value to go into the columnThis can even be an entirely new command!Use $_ to refer to whatever table row (object) is current Use to combine WMI info from two classes into a single output! Crazy syntax, but crazy useful!
NOW… let’s do some Q&A I’ve got more demos to show you, but want to make sure I address your questions Ask ‘em now! The remainder of the session will be additional demos Remember: Transcript will be downloadable; no need to copy down the syntax Ask for a “reminder card” if you want to download this stuff next week.
Final Notes… Please be sure to submit a session evaluation form! Download slides & materials from www.ConcentratedTech.com within one week! Blog, URLs, and other information is also available at www.ConcentratedTech.com for your reference More resources at www.ShellHub.com Thank you very much!
Your Feedback is Important Please fill out a session evaluation form. Thank you!
This slide deck was used in one of our many conference presentations. We hope you enjoy it, and invite you to use it within your own organization however you like. For more information on our company, including information on private classes and upcoming conference appearances, please visit our Web site, www.ConcentratedTech.com.  For links to newly-posted decks, follow us on Twitter:@concentrateddon or @concentratdgreg This work is copyright ©Concentrated Technology, LLC

Contenu connexe

Tendances

Virtualization auditing & security deck v1.0
Virtualization auditing & security deck v1.0Virtualization auditing & security deck v1.0
Virtualization auditing & security deck v1.0Concentrated Technology
 
Automating Active Directory mgmt in PowerShell
Automating Active Directory mgmt in PowerShellAutomating Active Directory mgmt in PowerShell
Automating Active Directory mgmt in PowerShellConcentrated Technology
 
Drupal Camp LA 2011: Typography modules for Drupal
Drupal Camp LA 2011: Typography modules for DrupalDrupal Camp LA 2011: Typography modules for Drupal
Drupal Camp LA 2011: Typography modules for DrupalAshok Modi
 
Drupal Backend Performance and Scalability
Drupal Backend Performance and ScalabilityDrupal Backend Performance and Scalability
Drupal Backend Performance and ScalabilityAshok Modi
 
Ideal Deployment In .NET World
Ideal Deployment In .NET WorldIdeal Deployment In .NET World
Ideal Deployment In .NET WorldDima Pasko
 
Session on Selenium Powertools by Unmesh Gundecha
Session on Selenium Powertools by Unmesh GundechaSession on Selenium Powertools by Unmesh Gundecha
Session on Selenium Powertools by Unmesh GundechaAgile Testing Alliance
 
Features, Exportables & You
Features, Exportables & YouFeatures, Exportables & You
Features, Exportables & Youjskulski
 
Install WordPress Blogging Software with EasyPHP
Install WordPress Blogging Software with EasyPHPInstall WordPress Blogging Software with EasyPHP
Install WordPress Blogging Software with EasyPHPRupesh Kumar
 
Automating Post Exploitation with PowerShell
Automating Post Exploitation with PowerShellAutomating Post Exploitation with PowerShell
Automating Post Exploitation with PowerShellEnclaveSecurity
 
LivePC creation webcast
LivePC creation webcastLivePC creation webcast
LivePC creation webcastkelvin
 
Kautilya: Teensy beyond shell
Kautilya: Teensy beyond shellKautilya: Teensy beyond shell
Kautilya: Teensy beyond shellNikhil Mittal
 
Domino Security - not knowing is not an option (2016 edition)
Domino Security - not knowing is not an option (2016 edition)Domino Security - not knowing is not an option (2016 edition)
Domino Security - not knowing is not an option (2016 edition)Darren Duke
 
WordPress Security - 12 WordPress Security Fundamentals
WordPress Security - 12 WordPress Security FundamentalsWordPress Security - 12 WordPress Security Fundamentals
WordPress Security - 12 WordPress Security Fundamentalsfindingsimple
 

Tendances (20)

Supporting SQLserver
Supporting SQLserverSupporting SQLserver
Supporting SQLserver
 
PS scripting and modularization
PS scripting and modularizationPS scripting and modularization
PS scripting and modularization
 
Prepping software for w7 deployment
Prepping software for w7 deploymentPrepping software for w7 deployment
Prepping software for w7 deployment
 
Top ESXi command line v2.0
Top ESXi command line v2.0Top ESXi command line v2.0
Top ESXi command line v2.0
 
Automating ad with powershell
Automating ad with powershellAutomating ad with powershell
Automating ad with powershell
 
Virtualization auditing & security deck v1.0
Virtualization auditing & security deck v1.0Virtualization auditing & security deck v1.0
Virtualization auditing & security deck v1.0
 
Automating Active Directory mgmt in PowerShell
Automating Active Directory mgmt in PowerShellAutomating Active Directory mgmt in PowerShell
Automating Active Directory mgmt in PowerShell
 
Drupal Camp LA 2011: Typography modules for Drupal
Drupal Camp LA 2011: Typography modules for DrupalDrupal Camp LA 2011: Typography modules for Drupal
Drupal Camp LA 2011: Typography modules for Drupal
 
Drupal Backend Performance and Scalability
Drupal Backend Performance and ScalabilityDrupal Backend Performance and Scalability
Drupal Backend Performance and Scalability
 
Ideal Deployment In .NET World
Ideal Deployment In .NET WorldIdeal Deployment In .NET World
Ideal Deployment In .NET World
 
Pantheon basics
Pantheon basicsPantheon basics
Pantheon basics
 
Session on Selenium Powertools by Unmesh Gundecha
Session on Selenium Powertools by Unmesh GundechaSession on Selenium Powertools by Unmesh Gundecha
Session on Selenium Powertools by Unmesh Gundecha
 
Features, Exportables & You
Features, Exportables & YouFeatures, Exportables & You
Features, Exportables & You
 
Install WordPress Blogging Software with EasyPHP
Install WordPress Blogging Software with EasyPHPInstall WordPress Blogging Software with EasyPHP
Install WordPress Blogging Software with EasyPHP
 
Keep Applications Online
Keep Applications OnlineKeep Applications Online
Keep Applications Online
 
Automating Post Exploitation with PowerShell
Automating Post Exploitation with PowerShellAutomating Post Exploitation with PowerShell
Automating Post Exploitation with PowerShell
 
LivePC creation webcast
LivePC creation webcastLivePC creation webcast
LivePC creation webcast
 
Kautilya: Teensy beyond shell
Kautilya: Teensy beyond shellKautilya: Teensy beyond shell
Kautilya: Teensy beyond shell
 
Domino Security - not knowing is not an option (2016 edition)
Domino Security - not knowing is not an option (2016 edition)Domino Security - not knowing is not an option (2016 edition)
Domino Security - not knowing is not an option (2016 edition)
 
WordPress Security - 12 WordPress Security Fundamentals
WordPress Security - 12 WordPress Security FundamentalsWordPress Security - 12 WordPress Security Fundamentals
WordPress Security - 12 WordPress Security Fundamentals
 

En vedette

Managing SQLserver for the reluctant DBA
Managing SQLserver for the reluctant DBAManaging SQLserver for the reluctant DBA
Managing SQLserver for the reluctant DBAConcentrated Technology
 
Free tools for rapidly deploying software
Free tools for rapidly deploying softwareFree tools for rapidly deploying software
Free tools for rapidly deploying softwareConcentrated Technology
 
Free tools for win server administration
Free tools for win server administrationFree tools for win server administration
Free tools for win server administrationConcentrated Technology
 
Advanced Tools & Scripting with PowerShell 3.0 Jump Start - Certificate
Advanced Tools & Scripting with PowerShell 3.0 Jump Start - CertificateAdvanced Tools & Scripting with PowerShell 3.0 Jump Start - Certificate
Advanced Tools & Scripting with PowerShell 3.0 Jump Start - CertificateDon Reese
 
Managing enterprise with PowerShell remoting
Managing enterprise with PowerShell remotingManaging enterprise with PowerShell remoting
Managing enterprise with PowerShell remotingConcentrated Technology
 
VDI-in-a-Box: Microsoft Desktop Virtualization for Smaller Businesses and Uses
VDI-in-a-Box:  Microsoft Desktop Virtualization for Smaller Businesses and UsesVDI-in-a-Box:  Microsoft Desktop Virtualization for Smaller Businesses and Uses
VDI-in-a-Box: Microsoft Desktop Virtualization for Smaller Businesses and UsesConcentrated Technology
 
PowerShell Functions
PowerShell FunctionsPowerShell Functions
PowerShell Functionsmikepfeiffer
 
Introduction to powershell
Introduction to powershellIntroduction to powershell
Introduction to powershellSalaudeen Rajack
 
Three cool cmdlets I wish PowerShell Had!
Three cool cmdlets I wish PowerShell Had!Three cool cmdlets I wish PowerShell Had!
Three cool cmdlets I wish PowerShell Had!Thomas Lee
 
PowerShell and the Future of Windows Automation
PowerShell and the Future of Windows AutomationPowerShell and the Future of Windows Automation
PowerShell and the Future of Windows AutomationConcentrated Technology
 
Basic PowerShell Toolmaking - Spiceworld 2016 session
Basic PowerShell Toolmaking - Spiceworld 2016 sessionBasic PowerShell Toolmaking - Spiceworld 2016 session
Basic PowerShell Toolmaking - Spiceworld 2016 sessionRob Dunn
 

En vedette (20)

No-script PowerShell v2
No-script PowerShell v2No-script PowerShell v2
No-script PowerShell v2
 
Managing SQLserver for the reluctant DBA
Managing SQLserver for the reluctant DBAManaging SQLserver for the reluctant DBA
Managing SQLserver for the reluctant DBA
 
Free tools for rapidly deploying software
Free tools for rapidly deploying softwareFree tools for rapidly deploying software
Free tools for rapidly deploying software
 
Ad disasters & how to prevent them
Ad disasters & how to prevent themAd disasters & how to prevent them
Ad disasters & how to prevent them
 
Free tools for win server administration
Free tools for win server administrationFree tools for win server administration
Free tools for win server administration
 
Advanced Tools & Scripting with PowerShell 3.0 Jump Start - Certificate
Advanced Tools & Scripting with PowerShell 3.0 Jump Start - CertificateAdvanced Tools & Scripting with PowerShell 3.0 Jump Start - Certificate
Advanced Tools & Scripting with PowerShell 3.0 Jump Start - Certificate
 
Managing SQLserver
Managing SQLserverManaging SQLserver
Managing SQLserver
 
Managing enterprise with PowerShell remoting
Managing enterprise with PowerShell remotingManaging enterprise with PowerShell remoting
Managing enterprise with PowerShell remoting
 
Implementing dr w. hyper v clustering
Implementing dr w. hyper v clusteringImplementing dr w. hyper v clustering
Implementing dr w. hyper v clustering
 
Ha & drs gotcha's
Ha & drs gotcha'sHa & drs gotcha's
Ha & drs gotcha's
 
PowerShell crash course
PowerShell crash coursePowerShell crash course
PowerShell crash course
 
Best free tools for win database admin
Best free tools for win database adminBest free tools for win database admin
Best free tools for win database admin
 
VDI-in-a-Box: Microsoft Desktop Virtualization for Smaller Businesses and Uses
VDI-in-a-Box:  Microsoft Desktop Virtualization for Smaller Businesses and UsesVDI-in-a-Box:  Microsoft Desktop Virtualization for Smaller Businesses and Uses
VDI-in-a-Box: Microsoft Desktop Virtualization for Smaller Businesses and Uses
 
PowerShell Functions
PowerShell FunctionsPowerShell Functions
PowerShell Functions
 
Introduction to powershell
Introduction to powershellIntroduction to powershell
Introduction to powershell
 
Three cool cmdlets I wish PowerShell Had!
Three cool cmdlets I wish PowerShell Had!Three cool cmdlets I wish PowerShell Had!
Three cool cmdlets I wish PowerShell Had!
 
PowerShell and WMI
PowerShell and WMIPowerShell and WMI
PowerShell and WMI
 
PowerShell and the Future of Windows Automation
PowerShell and the Future of Windows AutomationPowerShell and the Future of Windows Automation
PowerShell and the Future of Windows Automation
 
Basic PowerShell Toolmaking - Spiceworld 2016 session
Basic PowerShell Toolmaking - Spiceworld 2016 sessionBasic PowerShell Toolmaking - Spiceworld 2016 session
Basic PowerShell Toolmaking - Spiceworld 2016 session
 
Meet Windows PowerShell
Meet Windows PowerShellMeet Windows PowerShell
Meet Windows PowerShell
 

Similaire à PowerShell crashcourse for Sharepoint admins

PowerShell Core Skills (TechMentor Fall 2011)
PowerShell Core Skills (TechMentor Fall 2011)PowerShell Core Skills (TechMentor Fall 2011)
PowerShell Core Skills (TechMentor Fall 2011)Concentrated Technology
 
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with PowershellBrian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with PowershellSharePoint Saturday NY
 
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with PowershellBrian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with PowershellSharePoint Saturday NY
 
PowerShell 101
PowerShell 101PowerShell 101
PowerShell 101Thomas Lee
 
Introduction to PowerShell
Introduction to PowerShellIntroduction to PowerShell
Introduction to PowerShellBoulos Dib
 
JavaScript guide 2020 Learn JavaScript
JavaScript guide 2020 Learn JavaScriptJavaScript guide 2020 Learn JavaScript
JavaScript guide 2020 Learn JavaScriptLaurence Svekis ✔
 
Holy PowerShell, BATman! - dogfood edition
Holy PowerShell, BATman! - dogfood editionHoly PowerShell, BATman! - dogfood edition
Holy PowerShell, BATman! - dogfood editionDave Diehl
 
A Lap Around Visual Studio 2010
A Lap Around Visual Studio 2010A Lap Around Visual Studio 2010
A Lap Around Visual Studio 2010Abram John Limpin
 
SQL Server Integration Services Tips & Tricks
SQL Server Integration Services Tips & TricksSQL Server Integration Services Tips & Tricks
SQL Server Integration Services Tips & TricksGuillermo Caicedo
 
Professional Help for PowerShell Modules
Professional Help for PowerShell ModulesProfessional Help for PowerShell Modules
Professional Help for PowerShell ModulesJune Blender
 
NIIT ISAS Q5 Report - Windows PowerShell
NIIT ISAS Q5 Report - Windows PowerShellNIIT ISAS Q5 Report - Windows PowerShell
NIIT ISAS Q5 Report - Windows PowerShellPhan Hien
 
Working Effectively With Legacy Perl Code
Working Effectively With Legacy Perl CodeWorking Effectively With Legacy Perl Code
Working Effectively With Legacy Perl Codeerikmsp
 
PHP North-East - Automated Deployment
PHP North-East - Automated DeploymentPHP North-East - Automated Deployment
PHP North-East - Automated DeploymentMichael Peacock
 
Automated Deployment
Automated DeploymentAutomated Deployment
Automated Deploymentphpne
 
Powershell Training
Powershell TrainingPowershell Training
Powershell TrainingFahad Noaman
 
Inventory your network and clients with PowerShell
Inventory your network and clients with PowerShellInventory your network and clients with PowerShell
Inventory your network and clients with PowerShellConcentrated Technology
 
PowerShell Scripting and Modularization (TechMentor Fall 2011)
PowerShell Scripting and Modularization (TechMentor Fall 2011)PowerShell Scripting and Modularization (TechMentor Fall 2011)
PowerShell Scripting and Modularization (TechMentor Fall 2011)Concentrated Technology
 

Similaire à PowerShell crashcourse for Sharepoint admins (20)

PowerShell Core Skills (TechMentor Fall 2011)
PowerShell Core Skills (TechMentor Fall 2011)PowerShell Core Skills (TechMentor Fall 2011)
PowerShell Core Skills (TechMentor Fall 2011)
 
Admin SharePoint 2010 with PowerShell
Admin SharePoint 2010 with PowerShellAdmin SharePoint 2010 with PowerShell
Admin SharePoint 2010 with PowerShell
 
PowerShell-1
PowerShell-1PowerShell-1
PowerShell-1
 
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with PowershellBrian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
 
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with PowershellBrian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
 
PowerShell 101
PowerShell 101PowerShell 101
PowerShell 101
 
Introduction to PowerShell
Introduction to PowerShellIntroduction to PowerShell
Introduction to PowerShell
 
JavaScript guide 2020 Learn JavaScript
JavaScript guide 2020 Learn JavaScriptJavaScript guide 2020 Learn JavaScript
JavaScript guide 2020 Learn JavaScript
 
Holy PowerShell, BATman! - dogfood edition
Holy PowerShell, BATman! - dogfood editionHoly PowerShell, BATman! - dogfood edition
Holy PowerShell, BATman! - dogfood edition
 
A Lap Around Visual Studio 2010
A Lap Around Visual Studio 2010A Lap Around Visual Studio 2010
A Lap Around Visual Studio 2010
 
SQL Server Integration Services Tips & Tricks
SQL Server Integration Services Tips & TricksSQL Server Integration Services Tips & Tricks
SQL Server Integration Services Tips & Tricks
 
Professional Help for PowerShell Modules
Professional Help for PowerShell ModulesProfessional Help for PowerShell Modules
Professional Help for PowerShell Modules
 
NIIT ISAS Q5 Report - Windows PowerShell
NIIT ISAS Q5 Report - Windows PowerShellNIIT ISAS Q5 Report - Windows PowerShell
NIIT ISAS Q5 Report - Windows PowerShell
 
Working Effectively With Legacy Perl Code
Working Effectively With Legacy Perl CodeWorking Effectively With Legacy Perl Code
Working Effectively With Legacy Perl Code
 
Atomic design
Atomic designAtomic design
Atomic design
 
PHP North-East - Automated Deployment
PHP North-East - Automated DeploymentPHP North-East - Automated Deployment
PHP North-East - Automated Deployment
 
Automated Deployment
Automated DeploymentAutomated Deployment
Automated Deployment
 
Powershell Training
Powershell TrainingPowershell Training
Powershell Training
 
Inventory your network and clients with PowerShell
Inventory your network and clients with PowerShellInventory your network and clients with PowerShell
Inventory your network and clients with PowerShell
 
PowerShell Scripting and Modularization (TechMentor Fall 2011)
PowerShell Scripting and Modularization (TechMentor Fall 2011)PowerShell Scripting and Modularization (TechMentor Fall 2011)
PowerShell Scripting and Modularization (TechMentor Fall 2011)
 

Plus de Concentrated Technology (9)

Wsus sample scripts
Wsus sample scriptsWsus sample scripts
Wsus sample scripts
 
Wsus best practices
Wsus best practicesWsus best practices
Wsus best practices
 
Virtualization today
Virtualization todayVirtualization today
Virtualization today
 
Vdi in-a-box
Vdi in-a-boxVdi in-a-box
Vdi in-a-box
 
Securely connecting to apps over the internet using rds
Securely connecting to apps over the internet using rdsSecurely connecting to apps over the internet using rds
Securely connecting to apps over the internet using rds
 
Rapidly deploying software
Rapidly deploying softwareRapidly deploying software
Rapidly deploying software
 
Iis implementation
Iis implementationIis implementation
Iis implementation
 
Hyper v r2 deep dive
Hyper v r2 deep diveHyper v r2 deep dive
Hyper v r2 deep dive
 
How to configure esx to pass an audit
How to configure esx to pass an auditHow to configure esx to pass an audit
How to configure esx to pass an audit
 

Dernier

CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 

Dernier (20)

CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 

PowerShell crashcourse for Sharepoint admins

  • 1. Windows PowerShellCrash Course forSharePoint Administrators Don JonesConcentrated Technology, LLChttp://concentratedtech.com
  • 2. This slide deck was used in one of our many conference presentations. We hope you enjoy it, and invite you to use it within your own organization however you like. For more information on our company, including information on private classes and upcoming conference appearances, please visit our Web site, www.ConcentratedTech.com. For links to newly-posted decks, follow us on Twitter:@concentrateddon or @concentratdgreg This work is copyright ©Concentrated Technology, LLC
  • 3. CAUTION: DEMOS AHEAD This is a demonstration-intensive session (very few slides) I will capture a shell transcript and save all of my scripts You can download these (in a week or so) from ConcentratedTech.com (there’s a “Conference Materials” link in the menu)
  • 4. Welcome to the Shell Why did Microsoft write PowerShell? Is this a replacement for Cmd.exe or VBScript? How much “scripting” do I need to learn? How long will PowerShell be around? What versions of Windows does it work with? What MS products are PowerShell-ed?
  • 5. Command Quiz Change directories Make a directory Get a list of files and folders Display contents of a text file Move a file Copy a file Delete a file
  • 6. Running Commands Run all the commands you’re used to, with almost exactly the same syntax (Ping, Ipconfig, etc) New “cmdlets” have a more consistent naming convention and more consistent parameters… but they’re just commands Use Help to read more; add –full or –examples for even more help; use wildcards to discover more commands and help topics
  • 7. One Set of Commands The file system is a hierarchical data store What other data stores does Windows use? Why not treat them as “disk drives” so that you can use the same set of commands?
  • 8. Extending the Shell PSSnapins (the old way) Get-PSSnapin –registered Add-PSSnapinname Get-Command –pssnapinname Modules (the new way) Get-Module –listavailable Import-Module name Get-Command –module name There’s only one shell – the “pre-made shells” are just pre-loading a snap-in or module for you
  • 9. Piping Just like Dir | More Export-, Out-, Format-, ConvertTo- are all useful verbs for piping Tip: Format- cmdlets go at the end of the pipeline. What they produce is only useful to Out-File, Out-Printer, Out-Host.
  • 10. Output Run Get-Process See the resulting table? The real table, in memory, is much bigger – PowerShell just doesn’t show it Pipe the table to Get-Member to see other available columns Or pipe it to Format-List * (since a list can hold more data than a table) You don’t have to pipe stuff to a file and then grep it; you can simply refer to columns by name
  • 11. More Piping Sorting: Sort-Object (or “Sort”) Filtering: Where-Object (or “Where”) Grouping: Group-Object (or “Group”) Measuring: Measure-Object (or “Measure”) Use Format- cmdlets to specify the columns (called “properties”) that you’d prefer to see
  • 12. Phys Ed Let’s see the pipeline work in real life. Volunteers needed. You may win a prize.
  • 13. How Pipeline input works Get-Service generates what type of table (ok, these are really “objects” and not a “table in memory,” but it’s all just words) Get-Service | Get-Member So when you runGet-Service | Stop-Servicehow does Stop-Service know what to do with what you piped in?
  • 14. Pipeline Input ByValue Look at the parameters of Stop-Service Do any of them accept pipeline input ByValue and accept the type of data being produced by Stop-Service?
  • 15. Now Consider This “BITS”,”w32time” | Stop-Service Those are strings“BITS” | Get-Member Does Stop-Service accept anything of the type String ByValue from the pipeline? This would work too:Get-Content names.txt | Stop-Service World this work?Get-Process | Stop-ServiceHmmm…
  • 16. Pipeline Input ByPropertyName If nothing will work ByValue, then the shell tries to match up input columns with parameter names ByPropertyName Let’s look atGet-Process | Get-Member Do any of those column names match up with parameter names of Stop-Service? Do the matching parameter names accept input from the pipeline ByPropertyName?
  • 17. Debugging Pipeline Input Trace-Command-Name PipelineBinding-PSHost-expression { Get-Process | Stop-Service }
  • 18. Fun trick! Import user info from a CSV and make new users out of them
  • 19. Workarounds What about when pipelining won’t work? Get-WmiObject-class Win32_BIOS-computername (type names.txt) Get-WmiObject-class Win32_BIOS-computername ( Get-ADComputer –filter * | Select –expand Name)
  • 20. Remote Control Requires PSH v2 Run Enable-PSRemoting to enable(or via GPO) on machines that will accept incoming connections Communicates over HTTP(s); authenticates with Kerberos Help about_remote* for more help
  • 21. 1:1, 1:n Remoting Enter-PSSession –computernamexExit-PSSession Invoke-Command-scriptblock { command(s) }-computernamex,x,x,x Notes: PSComputerName property FilePath switch to do a whole script
  • 22. More Options -credential -port -useSSL Etc Or create a persistent session using New-PSSession. Get the sessions with Get-PSSessionInvoke-Command –scr { whatever }-session (Get-PSSession)
  • 23. Implicit Remoting Start a session (maybe save it in a $variable for ease of referring to it) Import a module in the remote session Import the remote session into the local shell – just the commands from that module, and add a noun prefix Execute remote commands as if they were local!
  • 24. WMI Get-WmiObject-class whatever (e.g., “Win32_XXX”)-computername x,y,z-EA SilentlyContinue (why?)-Filter ”something” (why?) Let’s play with that…
  • 25. Awesome Advanced Trick Format-Table can accept a special item called a hashtable or dictionary as a property in a property list The dictionary must contain two items N: The name of the column you want to create E: The value to go into the columnThis can even be an entirely new command!Use $_ to refer to whatever table row (object) is current Use to combine WMI info from two classes into a single output! Crazy syntax, but crazy useful!
  • 26. NOW… let’s do some Q&A I’ve got more demos to show you, but want to make sure I address your questions Ask ‘em now! The remainder of the session will be additional demos Remember: Transcript will be downloadable; no need to copy down the syntax Ask for a “reminder card” if you want to download this stuff next week.
  • 27. Final Notes… Please be sure to submit a session evaluation form! Download slides & materials from www.ConcentratedTech.com within one week! Blog, URLs, and other information is also available at www.ConcentratedTech.com for your reference More resources at www.ShellHub.com Thank you very much!
  • 28. Your Feedback is Important Please fill out a session evaluation form. Thank you!
  • 29. This slide deck was used in one of our many conference presentations. We hope you enjoy it, and invite you to use it within your own organization however you like. For more information on our company, including information on private classes and upcoming conference appearances, please visit our Web site, www.ConcentratedTech.com. For links to newly-posted decks, follow us on Twitter:@concentrateddon or @concentratdgreg This work is copyright ©Concentrated Technology, LLC