From 169a41abc592849e5ea592b85c285a9be1c6a8ac Mon Sep 17 00:00:00 2001 From: AmareshB1Microsoft <162629236+AmareshB1Microsoft@users.noreply.github.com> Date: Sun, 17 Mar 2024 14:59:07 -0700 Subject: [PATCH 1/2] Update and rename assign-per-user-skype-for-business-online-policies-with-microsoft-365-powershell.md to assign-per-user-microsoft-teams-policies-with-microsoft-365-powershell.md --- ...ams-policies-with-microsoft-365-powershell.md} | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) rename microsoft-365/enterprise/{assign-per-user-skype-for-business-online-policies-with-microsoft-365-powershell.md => assign-per-user-microsoft-teams-policies-with-microsoft-365-powershell.md} (90%) diff --git a/microsoft-365/enterprise/assign-per-user-skype-for-business-online-policies-with-microsoft-365-powershell.md b/microsoft-365/enterprise/assign-per-user-microsoft-teams-policies-with-microsoft-365-powershell.md similarity index 90% rename from microsoft-365/enterprise/assign-per-user-skype-for-business-online-policies-with-microsoft-365-powershell.md rename to microsoft-365/enterprise/assign-per-user-microsoft-teams-policies-with-microsoft-365-powershell.md index 010e0cf5275..c4a9b8071af 100644 --- a/microsoft-365/enterprise/assign-per-user-skype-for-business-online-policies-with-microsoft-365-powershell.md +++ b/microsoft-365/enterprise/assign-per-user-microsoft-teams-policies-with-microsoft-365-powershell.md @@ -1,5 +1,5 @@ --- -title: "Assign per-user Skype for Business Online policies with PowerShell for Microsoft 365" +title: "Assign per-user Microsoft Teams policies with PowerShell for Microsoft 365" ms.author: kvice author: kelleyvice-msft manager: scotv @@ -15,21 +15,18 @@ f1.keywords: - NOCSH ms.custom: seo-marvel-apr2020 ms.assetid: 36743c86-46c2-46be-b9ed-ad9d4e85d186 -description: "Summary: Use PowerShell for Microsoft 365 to assign per-user communication settings with Skype for Business Online policies." +description: "Summary: Use PowerShell for Microsoft 365 to assign per-user communication settings with Microsoft Teams policies." --- -# Assign per-user Skype for Business Online policies with PowerShell for Microsoft 365 +# Assign per-user Microsoft Teams policies with PowerShell for Microsoft 365 *This article applies to both Microsoft 365 Enterprise and Office 365 Enterprise.* -Using PowerShell for Microsoft 365 is an efficient way to assign per-user communication settings with Skype for Business Online policies. +Using PowerShell for Microsoft 365 is an efficient way to assign per-user communication settings with Microsoft Teams policies. ## Prepare to run the PowerShell commands Use these instructions to get set up to run the commands (skip the steps you have already completed): - - > [!Note] - > Skype for Business Online Connector is currently part of the latest Teams PowerShell module. If you're using the latest Teams PowerShell public release, you don't need to install the Skype for Business Online Connector. 1. Install the [Teams PowerShell module](/microsoftteams/teams-powershell-install). @@ -40,7 +37,7 @@ Use these instructions to get set up to run the commands (skip the steps you hav Connect-MicrosoftTeams ``` - When prompted, enter your Skype for Business Online administrator account name and password. + When prompted, enter your Microsoft Teams administrator account name and password. ## Updating external communication settings for a user account @@ -68,7 +65,7 @@ EnablePublicCloudAudioVideoAccess : False EnableOutsideAccess : True ``` -Now that you know which policy to assign to Alex, we can assign that policy by using the [Grant-CsExternalAccessPolicy](/powershell/module/skype/Get-CsExternalAccessPolicy) cmdlet. Here is an example: +Now that you know which policy to assign to Alex, we can assign that policy by using the [Grant-CsExternalAccessPolicy](/powershell/module/teams/Get-CsExternalAccessPolicy) cmdlet. Here is an example: ```powershell Grant-CsExternalAccessPolicy -Identity "Alex Darrow" -PolicyName "FederationOnly" From 91a2055e6eee4d075ea97abccf592ae055db5dea Mon Sep 17 00:00:00 2001 From: AmareshB1Microsoft <162629236+AmareshB1Microsoft@users.noreply.github.com> Date: Sun, 17 Mar 2024 15:30:16 -0700 Subject: [PATCH 2/2] After Sfb Online retirement, these articles are duplicates of what exists already in OfficeDocs-SkypeForBusiness repo --- ...-policies-with-microsoft-365-powershell.md | 139 ------------------ ...-policies-with-microsoft-365-powershell.md | 130 ---------------- ...ss-online-with-microsoft-365-powershell.md | 77 ---------- 3 files changed, 346 deletions(-) delete mode 100644 microsoft-365/enterprise/assign-per-user-microsoft-teams-policies-with-microsoft-365-powershell.md delete mode 100644 microsoft-365/enterprise/manage-skype-for-business-online-policies-with-microsoft-365-powershell.md delete mode 100644 microsoft-365/enterprise/manage-skype-for-business-online-with-microsoft-365-powershell.md diff --git a/microsoft-365/enterprise/assign-per-user-microsoft-teams-policies-with-microsoft-365-powershell.md b/microsoft-365/enterprise/assign-per-user-microsoft-teams-policies-with-microsoft-365-powershell.md deleted file mode 100644 index c4a9b8071af..00000000000 --- a/microsoft-365/enterprise/assign-per-user-microsoft-teams-policies-with-microsoft-365-powershell.md +++ /dev/null @@ -1,139 +0,0 @@ ---- -title: "Assign per-user Microsoft Teams policies with PowerShell for Microsoft 365" -ms.author: kvice -author: kelleyvice-msft -manager: scotv -ms.date: 07/16/2020 -audience: ITPro -ms.topic: article -ms.service: microsoft-365-enterprise -ms.localizationpriority: medium -ms.collection: -- scotvorg -- Ent_O365 -f1.keywords: -- NOCSH -ms.custom: seo-marvel-apr2020 -ms.assetid: 36743c86-46c2-46be-b9ed-ad9d4e85d186 -description: "Summary: Use PowerShell for Microsoft 365 to assign per-user communication settings with Microsoft Teams policies." ---- - -# Assign per-user Microsoft Teams policies with PowerShell for Microsoft 365 - -*This article applies to both Microsoft 365 Enterprise and Office 365 Enterprise.* - -Using PowerShell for Microsoft 365 is an efficient way to assign per-user communication settings with Microsoft Teams policies. - -## Prepare to run the PowerShell commands - -Use these instructions to get set up to run the commands (skip the steps you have already completed): - -1. Install the [Teams PowerShell module](/microsoftteams/teams-powershell-install). - -2. Open a Windows PowerShell command prompt and run the following commands: - - ```powershell - Import-Module MicrosoftTeams - Connect-MicrosoftTeams - ``` - - When prompted, enter your Microsoft Teams administrator account name and password. - -## Updating external communication settings for a user account - -Suppose you want to change external communication settings on a user account. For example, you want to allow Alex to communicate with federated users (EnableFederationAccess is equal to True) but not with Windows Live users (EnablePublicCloudAccess equals False). To do that, you need to do two things: - -1. Find an external access policy that meets our criteria. - -2. Assign that external access policy to Alex. - -How do you determine which external access policy to assign Alex? The following command returns all the external access policies where EnableFederationAccess is set to True and EnablePublicCloudAccess is set to False: - -```powershell -Get-CsExternalAccessPolicy -Include All| Where-Object {$_.EnableFederationAccess -eq $True -and $_.EnablePublicCloudAccess -eq $False} -``` - -Unless you have created any custom instances of ExternalAccessPolicy, that command returns one policy that meets our criteria (FederationOnly). Here is an example: - -```powershell -Identity : Tag:FederationOnly -Description : -EnableFederationAccess : True -EnableXmppAccess : False -EnablePublicCloudAccess : False -EnablePublicCloudAudioVideoAccess : False -EnableOutsideAccess : True -``` - -Now that you know which policy to assign to Alex, we can assign that policy by using the [Grant-CsExternalAccessPolicy](/powershell/module/teams/Get-CsExternalAccessPolicy) cmdlet. Here is an example: - -```powershell -Grant-CsExternalAccessPolicy -Identity "Alex Darrow" -PolicyName "FederationOnly" -``` - -Assigning a policy is pretty simple: you simply specify the Identity of the user and the name of the policy to be assigned. - -And when it comes to policies and policy assignments, you're not limited to working with user accounts one a time. For example, suppose you need a list of all the users who are allowed to communicate with federated partners and with Windows Live users. We already know that those users have been assigned the external user access policy FederationAndPICDefault. Because we know that, you can display a list of all those users by running one simple command. Here is the command: - -```powershell -Get-CsOnlineUser -Filter {ExternalAccessPolicy -eq "FederationAndPICDefault"} | Select-Object DisplayName -``` - -In other words, show us all the users where the ExternalAccessPolicy property is set to FederationAndPICDefault. (And, in order to limit the amount of information that appears onscreen, use the Select-Object cmdlet to display show us only each user's display name.) - -To configure all our user accounts to use that same policy, use this command: - -```powershell -Get-CsOnlineUser | Grant-CsExternalAccessPolicy "FederationAndPICDefault" -``` - -This command uses Get-CsOnlineUser to return a collection of all the users who have been enabled for Lync, then sends all that information to Grant-CsExternalAccessPolicy, which assigns the FederationAndPICDefault policy to each and every user in the collection. - -As an additional example, suppose you've previously assigned Alex the FederationAndPICDefault policy and now you've changed your mind and would like him to be managed by the global external access policy. You can't explicitly assign the global policy to anyone. Instead, the global policy is used for a given user if no per-user policy is assigned to that user. Therefore, if we want Alex to be managed by the global policy, you need to *unassign* any per-user policy previously assigned to him. Here is an example command: - -```powershell -Grant-CsExternalAccessPolicy -Identity "Alex Darrow" -PolicyName $Null -``` - -This command sets the name of the external access policy assigned to Alex to a null value ($Null). Null means "nothing". In other words, no external access policy is assigned to Alex. When no external access policy is assigned to a user, that user then gets managed by the global policy. - -## Managing large numbers of users - -To manage large numbers of users (1000 or more), you need to batch the commands via a script block using the [Invoke-Command](/powershell/module/microsoft.powershell.core/invoke-command) cmdlet. In previous examples, each time a cmdlet is executed, it must set up the call and then wait for the result before sending it back. When using a script block, this allows the cmdlets to be executed remotely, and once completed, send the data back. - -```powershell -$s = Get-PSSession | Where-Object { ($.ComputerName -like '*.online.lync.com' -or $.Computername -eq 'api.interfaces.records.teams.microsoft.com') -and $.State -eq 'Opened' -and $.Availability -eq 'Available' } - -$users = Get-CsOnlineUser -Filter { ClientPolicy -eq $null } -ResultSize 500 - -$batch = 50 -$filter = '' -$total = $users.Count -$count = 0 - $users | ForEach-Object { - $upn = $_.UserPrincipalName - $filter += "(UserPrincipalName -eq '$upn')" - $batch-- - $count++ - if (($batch -eq 0) -or ($count -eq $total)) { - $filterSB=[ScriptBlock]::Create($filter) - Invoke-Command -Session $s -ScriptBlock {param($f) Get-CsOnlineUser -filter $f | Grant-CsClientPolicy -PolicyName "ClientPolicyNoIMURL" -Passthru | Grant-CsExternalAccessPolicy -PolicyName "FederationAndPICDefault"} -ArgumentList $filterSB - - # Reset - $batch = 50 - $filter = '' - } else { - $filter += " -or " - } -} -``` - -This will find 500 users at a time who do not have a client policy. It will grant them the client policy "ClientPolicyNoIMURL" and the external access policy "FederationAndPicDefault". The results are batched into groups of 50 and each batch of 50 is then sent to the remote machine. - -## See also - -[Manage Skype for Business Online with PowerShell](manage-skype-for-business-online-with-microsoft-365-powershell.md) - -[Manage Microsoft 365 with PowerShell](manage-microsoft-365-with-microsoft-365-powershell.md) - -[Getting started with PowerShell for Microsoft 365](getting-started-with-microsoft-365-powershell.md) diff --git a/microsoft-365/enterprise/manage-skype-for-business-online-policies-with-microsoft-365-powershell.md b/microsoft-365/enterprise/manage-skype-for-business-online-policies-with-microsoft-365-powershell.md deleted file mode 100644 index f793660af80..00000000000 --- a/microsoft-365/enterprise/manage-skype-for-business-online-policies-with-microsoft-365-powershell.md +++ /dev/null @@ -1,130 +0,0 @@ ---- -title: "Manage Skype for Business Online policies with PowerShell" -ms.author: kvice -author: kelleyvice-msft -manager: scotv -ms.date: 07/17/2020 -audience: ITPro -ms.topic: article -ms.service: microsoft-365-enterprise -ms.localizationpriority: medium -ms.collection: -- scotvorg -- Ent_O365 -f1.keywords: -- NOCSH -ms.custom: -ms.assetid: ff93a341-6f0f-4f06-9690-726052e1be64 -description: "Summary: Use PowerShell to manage your Skype for Business Online user account properties with policies." ---- - -# Manage Skype for Business Online policies with PowerShell - -*This article applies to both Microsoft 365 Enterprise and Office 365 Enterprise.* - -To manage many properties of user account for Skype for Business Online, you must specify them as properties of policies with PowerShell for Microsoft 365. - -## Before you begin - -Use these instructions to get set up to run the commands (skip the steps you have already completed): - - > [!Note] - > Skype for Business Online Connector is currently part of the latest Teams PowerShell module. If you're using the latest Teams PowerShell public release, you don't need to install the Skype for Business Online Connector. - -1. Install the [Teams PowerShell module](/microsoftteams/teams-powershell-install). - -2. Open a Windows PowerShell command prompt and run the following commands: - - ```powershell - Import-Module MicrosoftTeams - $userCredential = Get-Credential - Connect-MicrosoftTeams -Credential $userCredential - ``` - - When prompted, enter your Skype for Business Online administrator account name and password. - -## Manage user account policies - -Many Skype for Business Online user account properties are configured by using policies. Policies are simply collections of settings that can be applied to one or more users. To take a look at how a policy has been configured, you can run this example command for the FederationAndPICDefault policy: - -```powershell -Get-CsExternalAccessPolicy -Identity "FederationAndPICDefault" -``` - -In turn, you should get back something similar to this: - -```powershell -Identity : Tag:FederationAndPICDefault -Description : -EnableFederationAccess : True -EnableXmppAccess : False -EnablePublicCloudAccess : True -EnablePublicCloudAudioVideoAccess : True -EnableOutsideAccess : True -``` - -In this example, the values within this policy determine what a use can or cannot do when it comes to communicating with federated users. For example, the EnableOutsideAccess property must be set to True for a user to be able to communicate with people outside the organization. Note that this property does not appear in the Microsoft 365 admin center. Instead, the property is automatically set to True or False based on the other selections that you make. The other two properties of interest are: - -- **EnableFederationAccess** indicates whether the user can communicate with people from federated domains. - -- **EnablePublicCloudAccess** indicates whether the user can communicate with Windows Live users. - -Therefore, you don't directly change federation-related properties on user accounts (for example, **Set-CsUser -EnableFederationAccess $True**). Instead, you assign an account an external access policy that has the desired property values preconfigured. If we want a user to be able to communicate with federated users and with Windows Live users, that user account must be assigned a policy that allows those types of communication. - -If you want to know whether or not someone can communicate with users from outside the organization, you have to: - -- Determine which external access policy has been assigned to that user. - -- Determine which capabilities are or are not allowed by that policy. - -For example, you can do that by using this command: - -```powershell -Get-CsOnlineUser -Identity "Alex Darrow" | ForEach {Get-CsExternalAccessPolicy -Identity $_.ExternalAccessPolicy} -``` - -This command finds the policy assigned to the user, then finds the capabilities enabled or disabled within that policy. - -To manage Skype for Business Online policies with PowerShell, see the cmdlets for: - -- [Client policy](/previous-versions//mt228132(v=technet.10)#client-policy-cmdlets) -- [Conferencing policy](/previous-versions//mt228132(v=technet.10)#conferencing-policy-cmdlets) -- [Mobile policy](/previous-versions//mt228132(v=technet.10)#mobile-policy-cmdlets) -- [Online Voicemail policy](/previous-versions//mt228132(v=technet.10)#online-voicemail-policy-cmdlets) -- [Voice Routing policy](/previous-versions//mt228132(v=technet.10)#voice-routing-policy-cmdlets) - - -> [!NOTE] -> A Skype for Business Online dial plan is a policy in every respect except the name. The name "dial plan" was chosen instead of, say, "dialing policy" in order to provide backward compatibility with Office Communications Server and with Exchange. - -For example, to look at all the voice policies available for your use, run this command: - -```powershell -Get-CsVoicePolicy -``` - -> [!NOTE] -> That returns a list of all the voice policies available to you. Keep in mind, however, that not all policies can be assigned to all users. This is due to various restrictions involving licensing and geographic location. (The so-called "[usage location](/previous-versions/azure/dn194136(v=azure.100)).") If you want to know the external access policies and the conferencing policies that can be assigned to a particular user, use commands similar to these: - -```powershell -Get-CsConferencingPolicy -ApplicableTo "Alex Darrow" -Get-CsExternalAccessPolicy -ApplicableTo "Alex Darrow" -``` - -The ApplicableTo parameter limits the returned data to policies that can be assigned to the specified user (for example, Alex Darrow). Depending on licensing and usage location restrictions, that might represent a subset of all the available policies. - -In some cases, properties of policies are not used with Microsoft 365, while others can only be managed by Microsoft support personnel. - -With Skype for Business Online, users must be managed by a policy of some kind. If a valid policy-related property is blank, that means that the user in question is being managed by a global policy, which is a policy that is automatically applied to a user unless they are specifically assigned a per-user policy. Because we don't see a client policy listed for a user account, it is managed by the global policy. You can determine the global client policy with this command: - -```powershell -Get-CsClientPolicy -Identity "Global" -``` - -## See also - -[Manage Skype for Business Online with PowerShell](manage-skype-for-business-online-with-microsoft-365-powershell.md) - -[Manage Microsoft 365 with PowerShell](manage-microsoft-365-with-microsoft-365-powershell.md) - -[Getting started with PowerShell for Microsoft 365](getting-started-with-microsoft-365-powershell.md) diff --git a/microsoft-365/enterprise/manage-skype-for-business-online-with-microsoft-365-powershell.md b/microsoft-365/enterprise/manage-skype-for-business-online-with-microsoft-365-powershell.md deleted file mode 100644 index 28049a626d8..00000000000 --- a/microsoft-365/enterprise/manage-skype-for-business-online-with-microsoft-365-powershell.md +++ /dev/null @@ -1,77 +0,0 @@ ---- -title: "Manage Skype for Business Online with PowerShell" -ms.author: kvice -author: kelleyvice-msft -manager: scotv -ms.date: 03/15/2024 -audience: ITPro -ms.topic: article -ms.service: microsoft-365-enterprise -ms.localizationpriority: medium -ms.collection: -- scotvorg -- Ent_O365 -- must-keep -f1.keywords: -- NOCSH -ms.custom: -ms.assetid: 054c16e6-9fd1-4e85-a0e6-81788b8410ea -description: "Use PowerShell for Microsoft 365 to manage Skype for Business Online policies, per-user policies, and meeting settings." ---- - -# Manage Skype for Business Online with PowerShell - -*This article applies to both Microsoft 365 Enterprise and Office 365 Enterprise.* - -Skype for Business Online administrators are responsible for managing policies. Although you can do some of these tasks in the Microsoft 365 admin center, others are easier to do in PowerShell. - -## Before you start - -> [!NOTE] -> Skype for Business Online Connector is currently part of the latest Teams PowerShell module. If you're using the latest **Teams PowerShell** public release, you don't need to install the Skype for Business Online Connector. - -> [!NOTE] -> Skype for Business Online Admins can manage both **Teams** and **Skype for Business Online** app policies through PowerShell. - -Install the [Teams PowerShell module](/microsoftteams/teams-powershell-install). - -## Connect using admin credentials - -1. Open a Windows PowerShell command prompt window and run the following commands: - - ```powershell - Import-Module MicrosoftTeams - $userCredential = Get-Credential - Connect-MicrosoftTeams -Credential $userCredential - ``` - -2. In the **Windows PowerShell Credential Request** dialog box, type your administrator account name and password, and then select **OK**. - -## Connect using an admin account with multifactor authentication - -1. Open a Windows PowerShell command prompt window, and run the following commands: - - ```powershell - Import-Module MicrosoftTeams - Connect-MicrosoftTeams - ``` - -2. When prompted enter your Skype for Business Online administrator account name? - -3. In the **Sign in to your account** dialog box, type your Skype for Business Online administrator password and select **Sign in**. - -4. In the **Sign in to your account** dialog box, follow the instructions to add authentication information, such as a verification code, and then select **Verify**. - -For more information, see: - -- [Manage Skype for Business Online policies with PowerShell](manage-skype-for-business-online-policies-with-microsoft-365-powershell.md) - -- [Assign per-user Skype for Business Online policies with PowerShell](assign-per-user-skype-for-business-online-policies-with-microsoft-365-powershell.md) - -## See also - -[Manage Microsoft 365 with PowerShell](manage-microsoft-365-with-microsoft-365-powershell.md) - -[Get started with PowerShell for Microsoft 365](getting-started-with-microsoft-365-powershell.md) - -[Skype for Business PowerShell cmdlet references](/powershell/module/skype/)