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

DOCX
Cara Set Up FTP server di ubuntu
DOCX
Jffnms Manual
PPTX
April 2010-intro-to-remoting-part2
PPS
Slow system troubleshooting
DOCX
V mware converter best practices
PPTX
Feb 2010 Intro To Remoteing Part1
DOCX
Drupal 7,8 Coder and PHPcodesniffer installation guide
PDF
Lamp Server With Drupal Installation
Cara Set Up FTP server di ubuntu
Jffnms Manual
April 2010-intro-to-remoting-part2
Slow system troubleshooting
V mware converter best practices
Feb 2010 Intro To Remoteing Part1
Drupal 7,8 Coder and PHPcodesniffer installation guide
Lamp Server With Drupal Installation

What's hot (20)

PDF
How To Configure VNC Server on CentOS 7
DOCX
Document Management: Opendocman and LAMP installation on Cent OS
PDF
How To Install and Configure GNome on CentOS 7
PDF
Drupal7 MEMCACHE
PDF
How To Configure Nginx Load Balancer on CentOS 7
PDF
DNF Failed To Open Cache
PPTX
Mod deflate setup and testing
PDF
Instalar PENTAHO 5 en CentOS 6
PDF
Mysql administration
PDF
How To Reset root Password on CentOS 7
PDF
TFTP Installation Configuration Guide
PPT
PPT
DOC
Step by step enabling automatic dhcp server backup
PDF
How To Install and Configure Screen on CentOS 7
PPTX
How to Install LAMP in Ubuntu 14.04
PDF
How To Install and Configure Salt Master on Ubuntu
PDF
How To Install OpenFire in CentOS 7
PDF
VMWare Tools Installation and Troubleshooting Guide
PDF
instaling
How To Configure VNC Server on CentOS 7
Document Management: Opendocman and LAMP installation on Cent OS
How To Install and Configure GNome on CentOS 7
Drupal7 MEMCACHE
How To Configure Nginx Load Balancer on CentOS 7
DNF Failed To Open Cache
Mod deflate setup and testing
Instalar PENTAHO 5 en CentOS 6
Mysql administration
How To Reset root Password on CentOS 7
TFTP Installation Configuration Guide
Step by step enabling automatic dhcp server backup
How To Install and Configure Screen on CentOS 7
How to Install LAMP in Ubuntu 14.04
How To Install and Configure Salt Master on Ubuntu
How To Install OpenFire in CentOS 7
VMWare Tools Installation and Troubleshooting Guide
instaling
Ad

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

PPTX
Windows power shell basics
PPT
Power point on linux commands,appache,php,mysql,html,css,web 2.0
PPT
Linux presentation
PPTX
Windows PowerShell.pptx
PDF
The Domino 10 RHEL 7 Primer
PDF
Inspection and maintenance tools (Linux / OpenStack)
DOCX
How to install and configure LEMP stack
PDF
Prometheus and Docker (Docker Galway, November 2015)
PPT
Automating Active Directory mgmt in PowerShell
PDF
Your Inner Sysadmin - LonestarPHP 2015
PDF
Salt conf 2014 - Using SaltStack in high availability environments
PDF
LISA15: systemd, the Next-Generation Linux System Manager
PDF
Profiling PHP with Xdebug / Webgrind
PDF
Linux Server Deep Dives (DrupalCon Amsterdam)
PDF
linux_Commads
PDF
Dev ops
PDF
Linux : Booting and runlevels
PDF
Learn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdf
PPT
SaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
PPT
Unix Administration 2
Windows power shell basics
Power point on linux commands,appache,php,mysql,html,css,web 2.0
Linux presentation
Windows PowerShell.pptx
The Domino 10 RHEL 7 Primer
Inspection and maintenance tools (Linux / OpenStack)
How to install and configure LEMP stack
Prometheus and Docker (Docker Galway, November 2015)
Automating Active Directory mgmt in PowerShell
Your Inner Sysadmin - LonestarPHP 2015
Salt conf 2014 - Using SaltStack in high availability environments
LISA15: systemd, the Next-Generation Linux System Manager
Profiling PHP with Xdebug / Webgrind
Linux Server Deep Dives (DrupalCon Amsterdam)
linux_Commads
Dev ops
Linux : Booting and runlevels
Learn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdf
SaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
Unix Administration 2
Ad

Recently uploaded (20)

PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
A Presentation on Artificial Intelligence
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
Electronic commerce courselecture one. Pdf
PDF
cuic standard and advanced reporting.pdf
PDF
Machine learning based COVID-19 study performance prediction
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PPTX
Tartificialntelligence_presentation.pptx
PPTX
Machine Learning_overview_presentation.pptx
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PPTX
Spectroscopy.pptx food analysis technology
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
A Presentation on Artificial Intelligence
The Rise and Fall of 3GPP – Time for a Sabbatical?
SOPHOS-XG Firewall Administrator PPT.pptx
Electronic commerce courselecture one. Pdf
cuic standard and advanced reporting.pdf
Machine learning based COVID-19 study performance prediction
Assigned Numbers - 2025 - Bluetooth® Document
Tartificialntelligence_presentation.pptx
Machine Learning_overview_presentation.pptx
Accuracy of neural networks in brain wave diagnosis of schizophrenia
Spectroscopy.pptx food analysis technology
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
A comparative analysis of optical character recognition models for extracting...
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Group 1 Presentation -Planning and Decision Making .pptx
Unlocking AI with Model Context Protocol (MCP)
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf

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