Topic Last Modified: 2013-08-15

When using the Identity parameter, you may notice that the parameter value kenmyer@litwareinc.com is enclosed in double quotation marks:

Copy Code
-Identity "kenmyer@litwareinc.com"

One of the questions that people new to Windows PowerShell invariably ask is this: when should I use double quotation marks and when should I not use double quotation marks? There is no simple answer to this question, but there are some general rules to follow:

There are also certain Windows PowerShell parameters known as switch parameters that do not accept parameter values:

Copy Code
-WhatIf

Not only are parameter values not required when using a switch parameter, but including a parameter value will actually generate an error. For example, if you try to run this command:

Copy Code
-WhatIf $True

That command will fail with an error message similar to this:

Copy Code
Set-CsUserAcp : A positional parameter cannot be found that accepts argument 'True'.

Your ability to manage Lync Online by using Windows PowerShell requires that you know which cmdlets are available for use. You must also know which parameters are available for each cmdlet, and you must know the data type of each parameter (that is, whether the parameter accepts a date value, a string value, a number, and so on). This information (along with numerous examples on how to use the cmdlets) can be found in the Help topics for the Lync Online cmdlets. For example, here are the parameters available for use with the Set-CsTenantPublicProvider cmdlet:

Parameters for a specific PowerShell cmdlet

As you can see, the parameter table provides a description of the cmdlet; indicates whether the parameter is required (mandatory) or optional; and tells you the data type of each parameter. Note that the data type shown in the table is the official data type used by the .NET Framework. This means the data type is shown as System.Management.Automation.SwitchParameter instead of just Switch Parameter. Here’s a quick guide to the data types most commonly used by the Lync Online cmdlets:

Parameter Description

Microsoft.Rtc.Management.AD.UserIdParameter

A string value representing the Identity of a user. This is typically the user’s UPN or SIP address:

Copy Code
-Identity "kenmyer@litwareinc.com"

Microsoft.Rtc.Management.Deploy.Fqdn

An FQDN is a fully qualified domain name. For example:

Copy Code
-Fqdn "atl-lync-001.litwareinc.com"

System.Boolean

A Boolean value is a True/False value. Remember, you must use the Windows PowerShell variables $True and $False when specifying Boolean values:

Copy Code
-Enabled $True -EnterpriseVoiceEnabled $False

System.Guid

GUID is the acronym for globally unique identifier, a unique identifier which, in Lync Online, is assigned to each Lync Online tenant. For example:

Copy Code
-Tenant "38aad667-af54-4397-aaa7-e94c79ec2308"

You can retrieve the GUID assigned to your Lync Online tenants by using this command:

Copy Code
Get-CsTenant | Select-Object TenantId

System.Management.Automation.SwitchParameter

Switch parameters are named this because they are either switched on or they off. If the parameter is present, then the switch is on, so to speak; if the parameter is not present, the switch is off. For example, to use the Confirm parameter to require confirmation before running a command, include the Confirm parameter (without a parameter value) as part of the command. For example:

Copy Code
Remove-CsUserAcp -Identity "Ken Myer" -Confirm

If you do not want to require confirmation, then do not include the Confirm parameter:

Copy Code
Remove-CsUserAcp -Identity "Ken Myer"

System.String

A string value is an alphanumeric value; that is, it can contain (in general) any character that can be typed on the keyboard. For example:

Copy Code
-Password "abc123%&*"

It’s a good idea to enclose string values in double quotation marks. This isn’t always required. However, it is required if your string value contains a blank space or comma, or if it happens to be a reserved Windows PowerShell keyword. (A keyword is a command or other element that is part of the Windows PowerShell language itself. For example, “If” and “End” are both Windows PowerShell keywords. For more information, type the following command from the Windows PowerShell command prompt:

Get-Help about_Reserved_Words

See Also