SlideShare a Scribd company logo
www.danapardaz.net/en
DANA PARDAZ CO.
8 POWERSHELL COMMANDS EVERY
WINDOWS ADMINISTRATOR SHOULD
KNOW
www.danapardaz.net/en
1. GET-HELP
• It is perhaps the most important cmdlet an administrator
should know. The cmdlet provides help, details and examples
of other cmdlets if available. For example, the following
command shows the help of Get-Process cmdlet:
Get-Help -Name Get-Process
• Note that PowerShell is not case-sensitive, that is it doesn’t
matter whether you capitalize the cmdlet commands or not, but
people often capitalize the words to make it more readable.
www.danapardaz.net/en
2. GET-EXECUTIONPOLICY
• By default, PowerShell scripts are disabled to prevent malicious script
from harming your machine. Execution policy indicates whether it is
allowed to execute PowerShell scripts or not. It has 4 state as follows:
1. Restricted: default execution policy that locks PowerShell down so that
commands can be entered only interactively. PowerShell scripts cannot
run.
2. All Signed: execution policy in which scripts will be allowed to run, but
only if they are signed by a trusted publisher.
3. Remote Signed: execution policy that allows any PowerShell scripts that
have been locally created to run. Remotely created scripts are only allowed
to run if they are signed by a trusted publisher.
4. Unrestricted: policy that removes all restrictions from the execution policy.
Here, you are free to run scripts locally and remotely.
www.danapardaz.net/en
3. SET-EXECUTIONPOLICY
• The previous cmdlet, Get-ExecutionPolicy, shows the current
execution policy. In case you want to change it, try Set-
ExecutionPolicy:
Set-ExecutionPolicy Unrestricted
www.danapardaz.net/en
4. FIND THE 10 PROCESSES USING THE
MOST MEMORY OR CPU
• The Get-Process is a cmdlet to see the list of processes running
on your machine. You can use ps or gps instead since they are
its aliases. The following commands get the list of all
processes, then sort them by CPU or memory usage, and then
filter the output to show the 10 most consumers. The
commands are fairly self-explanatory.
ps | sort -p CPU -descending | select -first 10
ps | sort -p ws -descending | select -first 10
www.danapardaz.net/en
4. FIND THE 10 PROCESSES USING THE
MOST MEMORY OR CPU
www.danapardaz.net/en
5. STOP-PROCESS
• Administrators often encounter a frozen process they want to
get rid of. As we mentioned, Get-process or ps for short
returns the list of all processes. You can end the process by its
name or ID (you can obtain by Get-Process), as follows:
Stop-Process -Name explorer
Stop-Process -ID 2185
• Keep in mind that the process ID may change from session to
session.
www.danapardaz.net/en
6. EXPORT-CSV
• The Export-CSV cmdlet simplifies saving data as a comma-separated
values (CSV) file. To use this cmdlet, first generate data you want by
any other cmdlet, and then pipe that with Export-CSV to save the
output into a CSV file. For example, the following command save all
processes into a csv file:
ps | Export-Csv c:exporttest.csv
• As another cool example, the following command export all Active
Directory users into ADExport.csv file:
Get-ADUser –filter * | Export-Csv c:exportADExport.csv
• Read this article (How to Export Users from Active Directory to CSV
file?) to learn more about Active Directory exporting.
www.danapardaz.net/en
7. GET-SERVICE, STOP-SERVICE AND
START-SERVICE
• As it can be easily guessed from their name, Get-Service lists
all services regardless of their status (stopped, running, etc).
You can stop or start the service by Stop-Service and Start-
Service cmdlet. Write this command following “-Name” and the
actual name of the service. For example, you can stop and start
Spooler service (printer spooler service which is usually
restarted by admins when printer service stop working) as
follows:
Stop-Service -Name Spooler
Start-Service -Name Spooler
www.danapardaz.net/en
8. SET-SCHEDULEDJOB
• Automatically running a job at specific time has becoming one
the most wanted feature of administration process. The Set-
ScheduledJob cmdlet was first introduced in PowerShell 3.0 that
allows administrators to run any PowerShell script at a specific
time or on periodic schedule.
www.danapardaz.net/en
FOLLOW US AT:
• linkedin:
https://www.linkedin.com/showcase/13308693/
• Facebook:
https://www.facebook.com/Dana-Pardaz-Co-1276798922374926/
• Twitter:
https://twitter.com/danapardazen
• WordPress
http://danapardaz.wordpress.com/
• Read our blog at Danapardaz.net:
http://www.danapardaz.net/site/en/blog

More Related Content

What's hot

How To Configure VNC Server on CentOS 7
How To Configure VNC Server on CentOS 7How To Configure VNC Server on CentOS 7
How To Configure VNC Server on CentOS 7
VCP Muthukrishna
 
Document Management: Opendocman and LAMP installation on Cent OS
Document Management: Opendocman and LAMP installation on Cent OSDocument Management: Opendocman and LAMP installation on Cent OS
Document Management: Opendocman and LAMP installation on Cent OS
Siddharth Ram Dinesh
 
How To Install and Configure GNome on CentOS 7
How To Install and Configure GNome on CentOS 7How To Install and Configure GNome on CentOS 7
How To Install and Configure GNome on CentOS 7
VCP Muthukrishna
 
Drupal7 MEMCACHE
Drupal7 MEMCACHE Drupal7 MEMCACHE
Drupal7 MEMCACHE
Pankaj Chauhan
 
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
VCP Muthukrishna
 
DNF Failed To Open Cache
DNF Failed To Open CacheDNF Failed To Open Cache
DNF Failed To Open Cache
VCP Muthukrishna
 
Mod deflate setup and testing
Mod deflate setup and testingMod deflate setup and testing
Mod deflate setup and testing
mytunee
 
Instalar PENTAHO 5 en CentOS 6
Instalar PENTAHO 5 en CentOS 6Instalar PENTAHO 5 en CentOS 6
Instalar PENTAHO 5 en CentOS 6
Moisés Elías Araya
 
Mysql administration
Mysql administrationMysql administration
Mysql administration
beben benzy
 
How To Reset root Password on CentOS 7
How To Reset root Password on CentOS 7How To Reset root Password on CentOS 7
How To Reset root Password on CentOS 7
VCP Muthukrishna
 
TFTP Installation Configuration Guide
TFTP Installation Configuration GuideTFTP Installation Configuration Guide
TFTP Installation Configuration Guide
VCP Muthukrishna
 
Apache
ApacheApache
Apache
ApacheApache
Step by step enabling automatic dhcp server backup
Step by step enabling automatic dhcp server backupStep by step enabling automatic dhcp server backup
Step by step enabling automatic dhcp server backup
laonap166
 
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
VCP Muthukrishna
 
How to Install LAMP in Ubuntu 14.04
How to Install LAMP in Ubuntu 14.04How to Install LAMP in Ubuntu 14.04
How to Install LAMP in Ubuntu 14.04
Sanjary Edu
 
How To Install and Configure Salt Master on Ubuntu
How To Install and Configure Salt Master on UbuntuHow To Install and Configure Salt Master on Ubuntu
How To Install and Configure Salt Master on Ubuntu
VCP Muthukrishna
 
How To Install OpenFire in CentOS 7
How To Install OpenFire in CentOS 7How To Install OpenFire in CentOS 7
How To Install OpenFire in CentOS 7
VCP Muthukrishna
 
VMWare Tools Installation and Troubleshooting Guide
VMWare Tools Installation and Troubleshooting GuideVMWare Tools Installation and Troubleshooting Guide
VMWare Tools Installation and Troubleshooting Guide
VCP Muthukrishna
 
instaling
instalinginstaling
instaling
tutorialsruby
 

What's hot (20)

How To Configure VNC Server on CentOS 7
How To Configure VNC Server on CentOS 7How To Configure VNC Server on CentOS 7
How To Configure VNC Server on CentOS 7
 
Document Management: Opendocman and LAMP installation on Cent OS
Document Management: Opendocman and LAMP installation on Cent OSDocument Management: Opendocman and LAMP installation on Cent OS
Document Management: Opendocman and LAMP installation on Cent OS
 
How To Install and Configure GNome on CentOS 7
How To Install and Configure GNome on CentOS 7How To Install and Configure GNome on CentOS 7
How To Install and Configure GNome on CentOS 7
 
Drupal7 MEMCACHE
Drupal7 MEMCACHE Drupal7 MEMCACHE
Drupal7 MEMCACHE
 
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
 
DNF Failed To Open Cache
DNF Failed To Open CacheDNF Failed To Open Cache
DNF Failed To Open Cache
 
Mod deflate setup and testing
Mod deflate setup and testingMod deflate setup and testing
Mod deflate setup and testing
 
Instalar PENTAHO 5 en CentOS 6
Instalar PENTAHO 5 en CentOS 6Instalar PENTAHO 5 en CentOS 6
Instalar PENTAHO 5 en CentOS 6
 
Mysql administration
Mysql administrationMysql administration
Mysql administration
 
How To Reset root Password on CentOS 7
How To Reset root Password on CentOS 7How To Reset root Password on CentOS 7
How To Reset root Password on CentOS 7
 
TFTP Installation Configuration Guide
TFTP Installation Configuration GuideTFTP Installation Configuration Guide
TFTP Installation Configuration Guide
 
Apache
ApacheApache
Apache
 
Apache
ApacheApache
Apache
 
Step by step enabling automatic dhcp server backup
Step by step enabling automatic dhcp server backupStep by step enabling automatic dhcp server backup
Step by step enabling automatic dhcp server backup
 
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
 
How to Install LAMP in Ubuntu 14.04
How to Install LAMP in Ubuntu 14.04How to Install LAMP in Ubuntu 14.04
How to Install LAMP in Ubuntu 14.04
 
How To Install and Configure Salt Master on Ubuntu
How To Install and Configure Salt Master on UbuntuHow To Install and Configure Salt Master on Ubuntu
How To Install and Configure Salt Master on Ubuntu
 
How To Install OpenFire in CentOS 7
How To Install OpenFire in CentOS 7How To Install OpenFire in CentOS 7
How To Install OpenFire in CentOS 7
 
VMWare Tools Installation and Troubleshooting Guide
VMWare Tools Installation and Troubleshooting GuideVMWare Tools Installation and Troubleshooting Guide
VMWare Tools Installation and Troubleshooting Guide
 
instaling
instalinginstaling
instaling
 

Similar to 8 power shell commands every windows administrator should know

Windows power shell basics
Windows power shell basicsWindows power shell basics
Windows power shell basics
Dan Morrill
 
Linux presentation
Linux presentationLinux presentation
Linux presentation
Ajaigururaj R
 
Power point on linux commands,appache,php,mysql,html,css,web 2.0
Power point on linux commands,appache,php,mysql,html,css,web 2.0Power point on linux commands,appache,php,mysql,html,css,web 2.0
Power point on linux commands,appache,php,mysql,html,css,web 2.0
venkatakrishnan k
 
Windows PowerShell.pptx
Windows PowerShell.pptxWindows PowerShell.pptx
Windows PowerShell.pptx
MuhammadYasirKhan42
 
The Domino 10 RHEL 7 Primer
The Domino 10 RHEL 7 PrimerThe Domino 10 RHEL 7 Primer
The Domino 10 RHEL 7 Primer
Bill Malchisky Jr.
 
Inspection and maintenance tools (Linux / OpenStack)
Inspection and maintenance tools (Linux / OpenStack)Inspection and maintenance tools (Linux / OpenStack)
Inspection and maintenance tools (Linux / OpenStack)
Gerard Braad
 
How to install and configure LEMP stack
How to install and configure LEMP stackHow to install and configure LEMP stack
How to install and configure LEMP stack
RootGate
 
Prometheus and Docker (Docker Galway, November 2015)
Prometheus and Docker (Docker Galway, November 2015)Prometheus and Docker (Docker Galway, November 2015)
Prometheus and Docker (Docker Galway, November 2015)
Brian Brazil
 
Automating Active Directory mgmt in PowerShell
Automating Active Directory mgmt in PowerShellAutomating Active Directory mgmt in PowerShell
Automating Active Directory mgmt in PowerShell
Concentrated Technology
 
Your Inner Sysadmin - LonestarPHP 2015
Your Inner Sysadmin - LonestarPHP 2015Your Inner Sysadmin - LonestarPHP 2015
Your Inner Sysadmin - LonestarPHP 2015
Chris Tankersley
 
Salt conf 2014 - Using SaltStack in high availability environments
Salt conf 2014 - Using SaltStack in high availability environmentsSalt conf 2014 - Using SaltStack in high availability environments
Salt conf 2014 - Using SaltStack in high availability environments
Benjamin Cane
 
LISA15: systemd, the Next-Generation Linux System Manager
LISA15: systemd, the Next-Generation Linux System Manager LISA15: systemd, the Next-Generation Linux System Manager
LISA15: systemd, the Next-Generation Linux System Manager
Alison Chaiken
 
Profiling PHP with Xdebug / Webgrind
Profiling PHP with Xdebug / WebgrindProfiling PHP with Xdebug / Webgrind
Profiling PHP with Xdebug / Webgrind
Sam Keen
 
Linux Server Deep Dives (DrupalCon Amsterdam)
Linux Server Deep Dives (DrupalCon Amsterdam)Linux Server Deep Dives (DrupalCon Amsterdam)
Linux Server Deep Dives (DrupalCon Amsterdam)
Amin Astaneh
 
AIX Advanced Administration Knowledge Share
AIX Advanced Administration Knowledge ShareAIX Advanced Administration Knowledge Share
AIX Advanced Administration Knowledge Share
.Gastón. .Bx.
 
linux_Commads
linux_Commadslinux_Commads
linux_Commads
tastedone
 
Dev ops
Dev opsDev ops
Dev ops
Tom Hall
 
Linux : Booting and runlevels
Linux : Booting and runlevelsLinux : Booting and runlevels
Linux : Booting and runlevels
John Ombagi
 
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
ClapperboardCinemaPV
 
SaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
SaltConf14 - Ben Cane - Using SaltStack in High Availability EnvironmentsSaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
SaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
SaltStack
 

Similar to 8 power shell commands every windows administrator should know (20)

Windows power shell basics
Windows power shell basicsWindows power shell basics
Windows power shell basics
 
Linux presentation
Linux presentationLinux presentation
Linux presentation
 
Power point on linux commands,appache,php,mysql,html,css,web 2.0
Power point on linux commands,appache,php,mysql,html,css,web 2.0Power point on linux commands,appache,php,mysql,html,css,web 2.0
Power point on linux commands,appache,php,mysql,html,css,web 2.0
 
Windows PowerShell.pptx
Windows PowerShell.pptxWindows PowerShell.pptx
Windows PowerShell.pptx
 
The Domino 10 RHEL 7 Primer
The Domino 10 RHEL 7 PrimerThe Domino 10 RHEL 7 Primer
The Domino 10 RHEL 7 Primer
 
Inspection and maintenance tools (Linux / OpenStack)
Inspection and maintenance tools (Linux / OpenStack)Inspection and maintenance tools (Linux / OpenStack)
Inspection and maintenance tools (Linux / OpenStack)
 
How to install and configure LEMP stack
How to install and configure LEMP stackHow to install and configure LEMP stack
How to install and configure LEMP stack
 
Prometheus and Docker (Docker Galway, November 2015)
Prometheus and Docker (Docker Galway, November 2015)Prometheus and Docker (Docker Galway, November 2015)
Prometheus and Docker (Docker Galway, November 2015)
 
Automating Active Directory mgmt in PowerShell
Automating Active Directory mgmt in PowerShellAutomating Active Directory mgmt in PowerShell
Automating Active Directory mgmt in PowerShell
 
Your Inner Sysadmin - LonestarPHP 2015
Your Inner Sysadmin - LonestarPHP 2015Your Inner Sysadmin - LonestarPHP 2015
Your Inner Sysadmin - LonestarPHP 2015
 
Salt conf 2014 - Using SaltStack in high availability environments
Salt conf 2014 - Using SaltStack in high availability environmentsSalt conf 2014 - Using SaltStack in high availability environments
Salt conf 2014 - Using SaltStack in high availability environments
 
LISA15: systemd, the Next-Generation Linux System Manager
LISA15: systemd, the Next-Generation Linux System Manager LISA15: systemd, the Next-Generation Linux System Manager
LISA15: systemd, the Next-Generation Linux System Manager
 
Profiling PHP with Xdebug / Webgrind
Profiling PHP with Xdebug / WebgrindProfiling PHP with Xdebug / Webgrind
Profiling PHP with Xdebug / Webgrind
 
Linux Server Deep Dives (DrupalCon Amsterdam)
Linux Server Deep Dives (DrupalCon Amsterdam)Linux Server Deep Dives (DrupalCon Amsterdam)
Linux Server Deep Dives (DrupalCon Amsterdam)
 
AIX Advanced Administration Knowledge Share
AIX Advanced Administration Knowledge ShareAIX Advanced Administration Knowledge Share
AIX Advanced Administration Knowledge Share
 
linux_Commads
linux_Commadslinux_Commads
linux_Commads
 
Dev ops
Dev opsDev ops
Dev ops
 
Linux : Booting and runlevels
Linux : Booting and runlevelsLinux : Booting and runlevels
Linux : Booting and runlevels
 
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
 
SaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
SaltConf14 - Ben Cane - Using SaltStack in High Availability EnvironmentsSaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
SaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
 

Recently uploaded

System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - HiikeSystem Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
Hiike
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
HarisZaheer8
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Tatiana Kojar
 
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Jeffrey Haguewood
 
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdfNunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
flufftailshop
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
Dinusha Kumarasiri
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
alexjohnson7307
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStrDeep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
saastr
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Jeffrey Haguewood
 

Recently uploaded (20)

System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - HiikeSystem Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
 
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
 
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdfNunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStrDeep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
 

8 power shell commands every windows administrator should know

  • 1. www.danapardaz.net/en DANA PARDAZ CO. 8 POWERSHELL COMMANDS EVERY WINDOWS ADMINISTRATOR SHOULD KNOW
  • 2. www.danapardaz.net/en 1. GET-HELP • It is perhaps the most important cmdlet an administrator should know. The cmdlet provides help, details and examples of other cmdlets if available. For example, the following command shows the help of Get-Process cmdlet: Get-Help -Name Get-Process • Note that PowerShell is not case-sensitive, that is it doesn’t matter whether you capitalize the cmdlet commands or not, but people often capitalize the words to make it more readable.
  • 3. www.danapardaz.net/en 2. GET-EXECUTIONPOLICY • By default, PowerShell scripts are disabled to prevent malicious script from harming your machine. Execution policy indicates whether it is allowed to execute PowerShell scripts or not. It has 4 state as follows: 1. Restricted: default execution policy that locks PowerShell down so that commands can be entered only interactively. PowerShell scripts cannot run. 2. All Signed: execution policy in which scripts will be allowed to run, but only if they are signed by a trusted publisher. 3. Remote Signed: execution policy that allows any PowerShell scripts that have been locally created to run. Remotely created scripts are only allowed to run if they are signed by a trusted publisher. 4. Unrestricted: policy that removes all restrictions from the execution policy. Here, you are free to run scripts locally and remotely.
  • 4. www.danapardaz.net/en 3. SET-EXECUTIONPOLICY • The previous cmdlet, Get-ExecutionPolicy, shows the current execution policy. In case you want to change it, try Set- ExecutionPolicy: Set-ExecutionPolicy Unrestricted
  • 5. www.danapardaz.net/en 4. FIND THE 10 PROCESSES USING THE MOST MEMORY OR CPU • The Get-Process is a cmdlet to see the list of processes running on your machine. You can use ps or gps instead since they are its aliases. The following commands get the list of all processes, then sort them by CPU or memory usage, and then filter the output to show the 10 most consumers. The commands are fairly self-explanatory. ps | sort -p CPU -descending | select -first 10 ps | sort -p ws -descending | select -first 10
  • 6. www.danapardaz.net/en 4. FIND THE 10 PROCESSES USING THE MOST MEMORY OR CPU
  • 7. www.danapardaz.net/en 5. STOP-PROCESS • Administrators often encounter a frozen process they want to get rid of. As we mentioned, Get-process or ps for short returns the list of all processes. You can end the process by its name or ID (you can obtain by Get-Process), as follows: Stop-Process -Name explorer Stop-Process -ID 2185 • Keep in mind that the process ID may change from session to session.
  • 8. www.danapardaz.net/en 6. EXPORT-CSV • The Export-CSV cmdlet simplifies saving data as a comma-separated values (CSV) file. To use this cmdlet, first generate data you want by any other cmdlet, and then pipe that with Export-CSV to save the output into a CSV file. For example, the following command save all processes into a csv file: ps | Export-Csv c:exporttest.csv • As another cool example, the following command export all Active Directory users into ADExport.csv file: Get-ADUser –filter * | Export-Csv c:exportADExport.csv • Read this article (How to Export Users from Active Directory to CSV file?) to learn more about Active Directory exporting.
  • 9. www.danapardaz.net/en 7. GET-SERVICE, STOP-SERVICE AND START-SERVICE • As it can be easily guessed from their name, Get-Service lists all services regardless of their status (stopped, running, etc). You can stop or start the service by Stop-Service and Start- Service cmdlet. Write this command following “-Name” and the actual name of the service. For example, you can stop and start Spooler service (printer spooler service which is usually restarted by admins when printer service stop working) as follows: Stop-Service -Name Spooler Start-Service -Name Spooler
  • 10. www.danapardaz.net/en 8. SET-SCHEDULEDJOB • Automatically running a job at specific time has becoming one the most wanted feature of administration process. The Set- ScheduledJob cmdlet was first introduced in PowerShell 3.0 that allows administrators to run any PowerShell script at a specific time or on periodic schedule.
  • 11. www.danapardaz.net/en FOLLOW US AT: • linkedin: https://www.linkedin.com/showcase/13308693/ • Facebook: https://www.facebook.com/Dana-Pardaz-Co-1276798922374926/ • Twitter: https://twitter.com/danapardazen • WordPress http://danapardaz.wordpress.com/ • Read our blog at Danapardaz.net: http://www.danapardaz.net/site/en/blog