- Naming convention for the PowerShell sample that is used in the articles.
- Tips about that recommended way for working with the PowerShell sample.
- Basic introduction to the PowerShell command logic.
The PowerShell command “box” includes:
- PowerShell command: Representation of the variable will be displayed in bold triangular brackets <Variable>.
The Variable could be: User alias name, User email address, Distribution group name, Mailbox name etc.
- Example Section: for making the PowerShell command Syntax more clear, we will demonstrate the command using “Real” names.
- Adjustments & Customization: This section includes “improvement” to the PowerShell command. For Example: “filtering” the output results. Sometimes, we get too much information or additional formation that is not related to the information that we need. Additional example could be avoiding the need to “Confirm” the PowerShell command and more.
PowerShell Script Menu
Most of the PowerShell article includes a menu based script, which was created to simplify the exaction and the use of the PowerShell commands. In the bottom of the article you can find a link for downloading the script.
Tips and information about PowerShell in the article
Copy and Edit PowerShell commands
The preferred option is to copy and paste PowerShell command sample, into a text editor such as Notepad. By using text editor we can:
- Adjust the PowerShell code for our specific needs.
For example replace Variable names with a name of user from our organization.
- “Clean” unwanted characters.
When we copy the PowerShell code, the code could include “unwanted” characters such as format characters (that could be appeared when we copy the code from another format such as: HTML), or space characters. We need to remove unwanted space charters because each power shell “Sentence” should be pasted as a “complete line.” In case that the power shell “Sentence” includes unnecessary spaces, the PowerShell console interrupts each space as a “New line,” and the PowerShell command will not be executed as it was expected.
Some of the PowerShell samples include “Bulk Mode Commands.” The meaning is that this command could influence: one User/Mailbox, or 10,000 Users/Mailboxes.
So……. Please examine this command carefully, and be sure that you understand the consequences.
PowerShell command logic
If you want to get more information about PowerShell commands concepts, expand the following section:
When we want to address object, we use the Object identity. Each object has a couple of “Identities.”
For example, we can address user object by using the: User name, User Display name, User email address and so on. When we use the User display name, we should use Quotation marks around the User display name, because it includes spaces. For example: “John Dow.”
PowerShell command syntax
The format of the PowerShell command is similar to a “Human sentence”.
For example, the “meaning” of the command Get-Mailbox is: display a list of all existing Mailbox’s.
If we want to get information about specific Mailbox, we can use the command:
Get-Mailbox –identity John (display information about John Mailbox).
The first part in the PowerShell command is the “Action” such as: Get (display or bring object),
Remove (Delete Object),Set (configure properties of object) and so on.
We really want to know what you think about the article