New-CsTeamsWorkLocationDetectionPolicy
This cmdlet is used to create a new instance of the TeamsWorkLocationDetectionPolicy.
Syntax
Default (Default)
New-CsTeamsWorkLocationDetectionPolicy
[-EnableWorkLocationDetection <Boolean>]
[-UserSettingsDefault <String>]
[-Identity] <String>
[-Force]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Creates a new instance of the TeamsWorkLocationDetectionPolicy. This policy can be used to tailor the Automatic Update of work location experience in Microsoft Teams.
EnableWorkLocationDetection: specifies whether Microsoft Teams determines a user’s work location based on interaction with organization‑managed networks and devices. When enabled, Teams updates the user’s current work location using signals from administrator‑configured resources, such as desks or peripherals managed by the organization. This parameter does not collect or use geographic location data from users’ personal or mobile devices. Location information is used to support consistent location‑based experiences in Microsoft Teams and Microsoft 365 and is processed in accordance with the Microsoft Privacy Statement.UserSettingsDefault: specifies the default user consent behavior when automatic update of work location is enabled and only applies to WiFi, and has no impact on device-based detection.Disabled(default): Users must explicitly opt in (Ask mode).Enabled: Automatic update is enabled by default, and users can opt out (Inform mode).
Learn more about the admin configuration modes
The combination of these settings determines whether automatic update runs, which signals are active, and how users are informed.
Behavior matrix
| EnableWorkLocationDetection | UserSettingsDefault | Automatic detection behavior |
|---|---|---|
| False | (ignored) | Peripheral and Wi-Fi check-in are disabled. UserSettingsDefault is ignored. |
| True | Disabled | Peripheral and Wi-Fi check‑in are enabled. Wi‑Fi check‑in runs in Ask mode, meaning users will be asked to opt in before update activates. |
| True | Enabled | Peripheral and Wi‑Fi check‑in are enabled. Wi-Fi check-in runs in Inform mode, meaning Wi-Fi based update is on by default and users can opt out. |
| False | Enabled | Peripheral check‑in is disabled. Wi‑Fi check‑in is disabled. UserSettingsDefault is ignored when EnableWorkLocationDetection is set to False. |
Notes on behavior
- When EnableWorkLocationDetection is set to False, automatic update is fully disabled regardless of user defaults.
- When EnableWorkLocationDetection is set to True, UserSettingsDefault determines whether users experience Ask (opt‑in) or Inform (opt‑out) behavior.
- Peripheral and Wi‑Fi signals follow the same consent model and are not independently configured.
- Automatic update applies only to actual location for the current working day and is cleared at the end of a user’s working hours.
Examples
Example 1
PS C:\> New-CsTeamsWorkLocationDetectionPolicy -Identity wld-policy -EnableWorkLocationDetection $true
Identity EnableWorkLocationDetection UserSettingsDefault
-------- --------------------------- -------------------
Tag:wld-policy True Disabled
Creates a new policy instance with the identity wld-policy. EnableWorkLocationDetection is set to the value specified in the command, and UserSettingsDefault defaults to Disabled.
Example 2
PS C:\> New-CsTeamsWorkLocationDetectionPolicy -Identity wld-policy -UserSettingsDefault Enabled
Identity EnableWorkLocationDetection UserSettingsDefault
-------- --------------------------- -------------------
Tag:wld-policy False Enabled
Creates a new policy instance with the identity wld-policy. EnableWorkLocationDetection defaults to False and UserSettingsDefault is set to Enabled.
Parameters
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | cf |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-EnableWorkLocationDetection
This parameter specifies whether Microsoft Teams determines a user’s work location based on interaction with organization‑managed networks and devices. When enabled, users' work location gets updated using signals from administrator‑configured resources, such as desks or peripherals managed by the organization. This parameter does not collect or use geographic location data from users’ personal or mobile devices. Location information is used to support consistent location‑based experiences in Microsoft Teams and Microsoft 365 and is processed in accordance with the Microsoft Privacy Statement.
Parameter properties
| Type: | Boolean |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-Force
Suppresses the display of any non-fatal error message that might arise when running the command.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-Identity
Name of the new policy instance to be created.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | 1 |
| Mandatory: | True |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-UserSettingsDefault
This parameter specifies the default user consent behavior when Automatic Update of location is enabled.
Disabled (default): Users must explicitly opt in (Ask mode).
Enabled: Automatic update is enabled by default, and users can opt out (Inform mode).
Learn more about the admin configuration modes.
Parameter properties
| Type: | String |
| Default value: | Disabled |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | wi |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.