Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Microsoft Exchange Server PowerShell Essentials

You're reading from   Microsoft Exchange Server PowerShell Essentials Leverage the power of basic Windows PowerShell scripts to manage your Exchange messaging environment

Arrow left icon
Product type Paperback
Published in Feb 2016
Publisher
ISBN-13 9781782176039
Length 210 pages
Edition 1st Edition
Arrow right icon
Author (1):
Arrow left icon
Biswanath Banerjee Biswanath Banerjee
Author Profile Icon Biswanath Banerjee
Biswanath Banerjee
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. Getting Started with PowerShell 2. Learning Recipient Management FREE CHAPTER 3. Handling Distribution Groups 4. Exchange Security 5. Everything about Microsoft Exchange Policies 6. Handling Exchange Server Roles 7. Auditing and E-Discovery 8. Managing High Availability 9. Exploring EWS Managed API 10. Common Administration Tasks Index

Understanding PowerShell syntax

Windows PowerShell uses a verb-noun pair as a naming system. The name of each cmdlet includes a standard verb hyphenated with a specific noun. Verbs are used for specific actions in Windows PowerShell, and nouns are used to describe objects by users and system administrators. Here are some of the examples that show how little effort is required to work with cmdlets, and one does not have to memorize them.

Nouns in a cmdlet describe what the cmdlet will act on. For example, get-process, get-service, stop-process and stop-service. If this is used regularly, one can get to know the standard set of verbs and nouns used in PowerShell. With these verb-noun pair, hundreds of cmdlet names can be remembered and used.

You will be able to recognize the operation performed by a cmdlet by just reading the name as it is mostly apparent about the name used by a new command should relate to the operation. For example, get-computer will give you a list of computers on your network. Get-date and get-time will display the system date and time respectively. Similarly, stop-computer will shut down a computer. Set-date and set-time will set the system's date and time.

Let's look at how to list all the commands that have the particular verbs called Get and Set using Get-command with the –verb parameter. The output of this command is piped to display in a table format (more on this will be covered later in the Usage of pipelines section).

Understanding PowerShell syntax

In the next example, we will just use instead of a format table:

Understanding PowerShell syntax

Now, let's use the -Noun parameter, and we will find a list of commands that affect the same object type. For example, if you want to see commands that are available for managing computers, type the following command:

Understanding PowerShell syntax

Traditionally, the commands in the earlier shells usually do not have a consistent parameter name. Sometimes, they don't have a name at all, and even if they do, they are abbreviated to make typing easier. But, this makes it difficult for new users to understand the parameters that are used. In Windows PowerShell, consistency is encouraged by using developer guidance on the usage of parameter names.

The names of the parameters in Windows PowerShell have a hyphen '-' prepended to them to allow PowerShell to demarcate them as parameters. In the get-command –Noun example, the name of the parameter is Noun and is typed as –Noun.

The cmdlets in Windows PowerShell support several common parameters as the PowerShell engine controls these parameters. So, no matter how they are implemented, they will behave in a similar way. Another way to drive the consistency and learning of Windows PowerShell are some of the common parameters like—Confirm, WhatIf, outvariable, warningaction, warningvariable, debug, and verbose.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image