Share via


Remove-CsMobilityPolicy

 

Topic Last Modified: 2012-04-23

Removes an existing mobility policy. Mobility policies determine whether or not a user can use Call via Work, a feature that enables users to make and receive phone calls on their mobile phone by using their work phone number instead of their mobile phone number.

Syntax

Remove-CsMobilityPolicy -Identity <XdsIdentity> [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-WhatIf [<SwitchParameter>]]

Detailed Description

Microsoft Lync 2010 Mobile is a client application that enables users to run Microsoft Lync 2010 on their mobile phones. Call via Work provides a way for users to make calls on their mobile phone and yet have it appear as though the call originated from their work phone number instead of their mobile phone number. Users who have been enabled for Call via Work can achieve this either by dialing directly from their mobile phone or by using the dial-out conferencing option. With dial-out conferencing, a user effectively asks the Microsoft Lync Server 2010 Mobility Service server to make a call for them. The server will set up the call, and then call the user back on their mobile phone. After the user has answered, the server will then dial the party being called.

Both of these capabilities – the ability to run Lync 2010 Mobile and the ability to use Call via Work – are managed using mobility policies. When you install Microsoft Lync Server 2010, you will have a single, global mobility policy that applies to all your users. However, administrators can use the New-CsMobilityPolicy cmdlet to create custom policies at either the site or the per-user scope.

If you do create custom policies at either the site or the per-user scope you can later delete those policies by using the Remove-CsMobilityPolicy cmdlet. If you delete a per-user policy, then any users assigned that policy will be managed by the appropriate site policy (if one exists) or by the global policy. If you remove a site policy, users governed by that policy will then be managed by the global policy.

Note that you can also run Remove-CsMobilityPolicy against the global policy. If you do that, however, the global policy will not actually be deleted; instead, the properties in that policy will be reset to their default values. In this case, that means enabling Call via Work.

Who can run this cmdlet: By default, members of the following groups are authorized to run the Remove-CsMobilityPolicy cmdlet locally: RTCUniversalServerAdmins.

Parameters

Parameter Required Type Description

Identity

Required

XdsIdentity

Unique identifier for the client policy to be removed. To "remove" the global policy, use the following syntax:

-Identity global

Note, however, that the global policy cannot actually be removed. Instead, all the properties in that policy will be reset to their default values.

To remove a site policy, use syntax similar to this:

-Identity "site:Redmond"

To remove a per-user policy, use syntax similar to this:

-Identity "SalesDepartmentPolicy"

You cannot use wildcards when specifying a policy Identity.

Force

Optional

SwitchParameter

If this parameter is present, the policy will be removed even if it is currently assigned to at least one user. If this parameter is not present, then Remove-CsMobilityPolicy will not automatically remove a per-user policy that is assigned to at least one user. Instead, a confirmation prompt will appear asking if you are sure that you want to remove the policy. You must answer yes (by pressing the Y key) before the command will continue and the policy is removed.

This parameter applies only to per-user policies.

WhatIf

Optional

SwitchParameter

Describes what would happen if you executed the command without actually executing the command.

Confirm

Optional

SwitchParameter

Prompts you for confirmation before executing the command.

Input Types

Microsoft.Rtc.Management.WriteableConfig.Policy.Mobility.Mobility. Remove-CsMobilityPolicy accepts pipelined instances of the Mobility object.

Return Types

None. Instead, Remove-CsMobilityPolicy deletes instances of the Microsoft.Rtc.Management.WriteableConfig.Policy.Mobility.Mobility object.

Example

-------------------------- Example 1 --------------------------

Remove-CsMobilityPolicy -Identity "site:Redmond"

The command shown in Example 1 removes the mobility policy configured for the Redmond site. When the policy is removed, users previously managed by the Redmond site policy will now be managed by the global policy.

-------------------------- Example 2 --------------------------

Get-CsMobilityPolicy -Filter "tag:*" | Remove-CsMobilityPolicy

In Example 2, all the mobility policies configured at the per-user scope are removed. To do this, the command first uses the Get-CsMobilityPolicy cmdlet and the Filter parameter to retrieve all the policies that have an Identity that begins with the string value "Tag:"; by definition, any policy meeting that criterion will be a per-user policy. That collection of per-user policies is then piped to the Remove-CsMobilityPolicy cmdlet, which deletes each policy in the collection.

-------------------------- Example 3 --------------------------

Get-CsMobilityPolicy | Where-Object {$_.EnableOutsideVoice -eq $False} | Remove-CsMobilityPolicy

Example 3 demonstrates a way to delete all the mobility policies where Call via Work has been enabled. To do this, the command first uses Get-CsMobilityPolicy to retrieve a collection of all the mobility policies currently in use in the organization. That collection is then piped to the where-Object cmdlet, which picks out only those policies where the EnableOutsideVoice property is set to False. Any policies where EnableOutsideVoice is False are then piped to, and removed by, the Remove-CsMobilityPolicy cmdlet.