Jump to content

Commonly Used Windows PowerShell Cmdlets for Administration

0
  adfm's Photo
Posted Mar 31 2010 11:31 AM

Looking for a handy list of commonly used Windows PowerShell cmdlets? Here's such a list from William R. Stanek's Microsoft® Exchange Server 2010 Administrator's Pocket Consultant.


At the Windows PowerShell prompt, you can get a complete list of cmdlets available by typing get-command. However, the output lists both cmdlets and functions by name and definition. With cmdlets, the definition provided is the syntax, but the full syntax rarely fits on the line. A better way to get information about cmdlets is to use Get-Help. If you type get-help *-*, you get a list of all cmdlets, which includes a synopsis that summarizes the purpose of the cmdlet—which is much more useful than a list of commands. To get help documentation on a specific cmdlet, type get-help followed by the cmdlet name, such as:

get-help get-variable

Table 4.2, “Cmdlets Commonly Used for Administration” provides a list of cmdlets you'll commonly use for administration. Although many other cmdlets are available, these are the ones you're likely to use the most.

Table 4.2. Cmdlets Commonly Used for Administration

CMDLET NAME

DESCRIPTION

Add-Computer, Remove-Computer

Adds or removes a computer's membership in a domain or workgroup

Checkpoint-Computer, Restore-Computer

Creates a system restore checkpoint for a computer, or restores a computer from a checkpoint

Compare-Object, Group-Object, Sort-Object, Select-Object, New-Object

Cmdlets for comparing, grouping, sorting, selecting, and creating objects

ConvertFrom-SecureString, ConvertTo-SecureString

Cmdlets for creating or exporting secure strings

Get-Alias, New-Alias, Set-Alias, Export-Alias, Import-Alias

Cmdlets for getting, creating, setting, exporting, and importing aliases

Get-AuthenticodeSignature, Set-AuthenticodeSignature

Cmdlets for getting or setting the signature object associated with a file

Get-Command, Invoke-Command, Measure-Command, Trace-Command

Cmdlets for getting information about cmdlets, invoking commands, measuring the run time of commands, and tracing commands

Get-Counter

Gets performance counter data

Get-Credential

Gets a credential object based on a password

Get-Date, Set-Date

Gets or sets the current date and time

Get-EventLog, Write-EventLog, Clear-EventLog

Gets events, writes events, or clears events in an event log

Get-ExecutionPolicy, Set-ExecutionPolicy

Gets or sets the effective execution policy for the current shell

Get-Host

Gets information about the PowerShell host application

Get-HotFix

Gets the Quick Fix Engineering (QFE) updates that have been applied to a computer

Get-Location, Set-Location

Displays or sets the current working location

Get-Process, Start-Process, Stop-Process

Gets, starts, or stops processes on a computer

Get-PSDrive, New-PSDrive, Remove-PSDrive

Gets, creates, or removes a specified PowerShell drive

Get-Service, New-Service, Set-Service

Gets, creates, or sets system services

Get-Variable, New-Variable, Set-Variable, Remove-Variable, Clear-Variable

Cmdlets for getting, creating, setting, and removing variables as well as for clearing variable values

Import-Counter, Export-Counter

Imports or exports performance counter log files

Limit-EventLog

Sets the size and age limits for an event log

New-EventLog, Remove-EventLog

Creates or removes a custom event log and event source

Read-Host, Write-Host, Clear-Host

Reads input from, writes output to or clears the host window

Add-Computer, Remove-Computer, Stop-Computer, Restart-Computer

Adds or removes domain membership or stops or restarts a computer

Reset-ComputerMachinePassword

Changes and resets the machine account password that the computer uses to authenticate in a domain

Show-EventLog

Displays a computer's event logs in Event Viewer

Show-Service

Displays a computer's services in the Services utility

Start-Sleep

Suspends shell or script activity for the specified period

Stop-Service, Start-Service, Suspend-Service, Resume-Service, Restart-Service

Cmdlets for stopping, starting, suspending, resuming, and restarting system services

Wait-Process

Waits for a process to be stopped before accepting input

Write-Output

Writes an object to the pipeline

Write-Warning

Displays a warning message




Tags:
0 Subscribe


0 Replies