{"id":4862,"date":"2022-07-14T08:31:13","date_gmt":"2022-07-14T06:31:13","guid":{"rendered":"https:\/\/www.msb365.blog\/?p=4862"},"modified":"2022-07-14T08:31:13","modified_gmt":"2022-07-14T06:31:13","slug":"microsoft-teams-voice-caller-id-policy","status":"publish","type":"post","link":"https:\/\/www.msb365.blog\/?p=4862","title":{"rendered":"Microsoft Teams calling ID policies (plus Script documentation &#8211; How to)"},"content":{"rendered":"<p>An extremely important element in the field of telephony, apart from incoming calls and their management, is the element of outgoing calls.<\/p>\n<p>Each user has his or her personal telephone number, which also appears on the display when an outgoing call is made to the other party.<\/p>\n<p>Now, however, there is a requirement &#8211; especially with service providers &#8211; that a call should not be made from the personal telephone number, but from a collective number.<br \/>\nI am thinking of a support organization as an example. If a supporter has to call a customer back, the outgoing number should not be the personal number, but the number of the support team.<\/p>\n<p>Microsoft Teams offers the function &#8220;Caller ID policies&#8221; in the <a href=\"https:\/\/admin.teams.microsoft.com\/\" target=\"_blank\" rel=\"noopener\">Teams Admin Center<\/a> for this purpose. These can be found in the Admin Center under <strong>Voice<\/strong> &gt; <strong>Caller ID policies<\/strong>.<br \/>\nEditing the default policy is possible here, as well as creating new custom policies.<br \/>\nI personally do not recommend editing the default policy. This is because it is global. I create new custom policies whenever possible.<\/p>\n<p>&nbsp;<\/p>\n<h3>Create new Caller ID policies<\/h3>\n<p>Personally, I prefer to do this task via PowerShell. I like to refer to this <a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/skype\/new-cscallinglineidentity?view=skype-ps\" target=\"_blank\" rel=\"noopener\">Microsoft Technet article<\/a>.<\/p>\n<p>In order to simplify this process, I would like to share my personal experience with you.<\/p>\n<p>When creating a new caller ID policy, it is important to know what type of policy it should be. There are four different options:<\/p>\n<ul>\n<li>Anonymous<\/li>\n<li>Service<\/li>\n<li>LineUri<\/li>\n<li>Resource<\/li>\n<\/ul>\n<p>It is important to know that currently the option &#8220;Resource&#8221; cannot be configured via the Web GUI of the Teams Admin Center.<br \/>\nHowever, since in my case this is the variant I mostly need, I will show my example here.<\/p>\n<p>First, we need the object ID of the resource account for which we want to create our policy. We put the output of the required PowerShell command in a variable:<\/p>\n<pre>$ObjId = (Get-CsOnlineApplicationInstance -Identity support@contoso.onmicrosoft.com).ObjectId<\/pre>\n<p><strong>Note:<\/strong> Of course, the first thing we need to do is connect to our Teams Tenant via PowerShell. The first thing we need is the command:<\/p>\n<pre>Connect-MicrosoftTeams<\/pre>\n<p>Then we need the company name, which we can either enter manually or take the exact name from the tenant.<br \/>\nIf we decide on the second variant, we can do this as follows:<\/p>\n<pre>Connect-MsolService\r\n$company = Get-MsolCompanyInformation | select DisplayName<\/pre>\n<p>Now we can execute the actual command:<\/p>\n<pre>New-CsCallingLineIdentity -Identity 6600 -CallingIDSubstitute Resource -EnableUserOverride $false -ResourceAccount $ObjId -CompanyName $company -Description \"6600 Contoso Support\"<\/pre>\n<p>As you can see, we need more information for this command. The &#8220;<strong>Identity<\/strong>&#8221; is the display name of the policy that will later be assigned to the user.<br \/>\nThe &#8220;<strong>CallingIDSubstitute<\/strong>&#8221; describes the type of policy we saw at the beginning of this article.<br \/>\nThe &#8220;Description&#8221; is not a mandatory field, but I recommend including it as well, because it serves as a good basic documentation depending on the naming concept of the policies.<\/p>\n<p>Now the policy is created, and we can continue with the assignment.<\/p>\n<p>&nbsp;<\/p>\n<h3>Assigning users to the corresponding caller ID policies<\/h3>\n<p>There are three different ways in which a user can be assigned to the corresponding policy.<br \/>\nIf it is a matter of individual users and\/or policies, this can be done via the Admin Portal.<\/p>\n<p>Another possibility is to use PowerShell here as well.<br \/>\nFor individual users, this can look like this, for example:<\/p>\n<pre>Grant-CsCallingLineIdentity -Identity \"John.Doe@contoso.com\" -PolicyName 6600<\/pre>\n<p>This usually works very well and without problems.<\/p>\n<p>But what if we need to assign 200 (or more) users in 30 (or more) caller ID policies?<br \/>\nTo solve this chalange quickly and safely, I have created a PowerShell script.<br \/>\nTo use this script, you only need a CSV file which is structured as follows:<\/p>\n<pre>\"UserPrincipalName\",\"DisplayName\",PolicyName\u201c<\/pre>\n<p><strong>Note<\/strong>: If you want to remove the existing caller ID policy for several users, you can simply enter <strong>$Null<\/strong> in the CSV under PolicyName. This ensures that no caller ID policy is assigned to the corresponding user.<\/p>\n<p>&nbsp;<\/p>\n<h4>Here is how to use the script:<\/h4>\n<table>\n<tbody>\n<tr>\n<td width=\"301\"><a href=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2022\/06\/001.png\"><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone size-full wp-image-4866\" src=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2022\/06\/001.png\" alt=\"\" width=\"1379\" height=\"868\" srcset=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2022\/06\/001.png 1379w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2022\/06\/001-300x189.png 300w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2022\/06\/001-1024x645.png 1024w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2022\/06\/001-768x483.png 768w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2022\/06\/001-600x378.png 600w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2022\/06\/001-905x570.png 905w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2022\/06\/001-1320x831.png 1320w\" sizes=\"(max-width: 1379px) 100vw, 1379px\" \/><\/a><\/td>\n<td width=\"301\">After running the script for the first time, we have to accept the licence conditions, otherwise we cannot use this script.<\/td>\n<\/tr>\n<tr>\n<td width=\"301\"><a href=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2022\/06\/002.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-4867\" src=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2022\/06\/002.png\" alt=\"\" width=\"1377\" height=\"856\" srcset=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2022\/06\/002.png 1377w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2022\/06\/002-300x186.png 300w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2022\/06\/002-1024x637.png 1024w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2022\/06\/002-768x477.png 768w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2022\/06\/002-600x373.png 600w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2022\/06\/002-905x563.png 905w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2022\/06\/002-1320x821.png 1320w\" sizes=\"(max-width: 1377px) 100vw, 1377px\" \/><\/a><\/td>\n<td width=\"301\">Now the script asks us whether we want to connect to our Teams tenant. If we already have a connection to Microsoft Teams in the existing PowerShell window, we can continue here with &#8220;N&#8221;, otherwise we select the option &#8220;Y&#8221;.<\/td>\n<\/tr>\n<tr>\n<td width=\"301\"><a href=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2022\/06\/003.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-4868\" src=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2022\/06\/003.png\" alt=\"\" width=\"587\" height=\"1026\" srcset=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2022\/06\/003.png 587w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2022\/06\/003-172x300.png 172w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2022\/06\/003-586x1024.png 586w\" sizes=\"(max-width: 587px) 100vw, 587px\" \/><\/a><\/td>\n<td width=\"301\">If we have selected the option &#8220;Y&#8221;, we must now log on to the tenant.<\/td>\n<\/tr>\n<tr>\n<td width=\"301\"><a href=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2022\/06\/004.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4869\" src=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2022\/06\/004.png\" alt=\"\" width=\"1601\" height=\"1138\" srcset=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2022\/06\/004.png 1601w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2022\/06\/004-300x213.png 300w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2022\/06\/004-1024x728.png 1024w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2022\/06\/004-768x546.png 768w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2022\/06\/004-600x426.png 600w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2022\/06\/004-1536x1092.png 1536w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2022\/06\/004-905x643.png 905w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2022\/06\/004-1320x938.png 1320w\" sizes=\"(max-width: 1601px) 100vw, 1601px\" \/><\/a><\/td>\n<td width=\"301\">After the successful login, the script now starts its work and asks for the corresponding CSV, as described in this article.<\/p>\n<p>The format of the CSV is also displayed again.<\/p>\n<p>&nbsp;<\/p>\n<p>A window opens where we can comfortably browse for the corresponding CSV.<\/td>\n<\/tr>\n<tr>\n<td width=\"301\"><a href=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2022\/06\/005.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4870\" src=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2022\/06\/005.png\" alt=\"\" width=\"503\" height=\"175\" srcset=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2022\/06\/005.png 503w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2022\/06\/005-300x104.png 300w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2022\/06\/005-500x175.png 500w\" sizes=\"(max-width: 503px) 100vw, 503px\" \/><\/a><\/td>\n<td width=\"301\">After the import is complete, the script shows us the entire import again, so that we can check it again if necessary.<\/p>\n<p>If we have accidentally imported the wrong CSV, we can simply continue with &#8220;N&#8221; and select a new CSV file.<\/p>\n<p>However, if the information is correct, we continue with &#8220;Y&#8221;.<\/td>\n<\/tr>\n<tr>\n<td width=\"301\"><a href=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2022\/06\/006.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4871\" src=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2022\/06\/006.png\" alt=\"\" width=\"885\" height=\"422\" srcset=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2022\/06\/006.png 885w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2022\/06\/006-300x143.png 300w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2022\/06\/006-768x366.png 768w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2022\/06\/006-600x286.png 600w\" sizes=\"(max-width: 885px) 100vw, 885px\" \/><\/a><\/td>\n<td width=\"301\">Now the policies are created as entered in the CSV and displayed individually in the PowerShell window.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<blockquote><p>You can find the script itself on my <a href=\"https:\/\/github.com\/MSB365\/Handle-callingIDpolicies\" target=\"_blank\" rel=\"noopener\">GitHub<\/a> page.<\/p><\/blockquote>\n<p>As always, this script is available for free to anyone who needs it. You can download it from my GitHub repository and use it.<\/p>\n<p>&nbsp;<\/p>\n<p>Also as always, I assume no responsibility for possible misconfigurations and strongly recommend to use the first run of this script in a LAB or test environment.<\/p>\n<p>&nbsp;<\/p>\n<p>This script can be used and adapted indefinitely, but not sold to third parties.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>An extremely important element in the field of telephony, apart from incoming calls and their management, is the element of outgoing calls. Each user has his or her personal telephone number, which also appears on the display when an outgoing call is made to the other party. Now, however, there is a requirement &#8211; especially [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":4865,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[1923,15,3],"tags":[],"class_list":["post-4862","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-microsoft-365","category-ms-teams","category-powershell"],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/www.msb365.blog\/index.php?rest_route=\/wp\/v2\/posts\/4862","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.msb365.blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.msb365.blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.msb365.blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.msb365.blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4862"}],"version-history":[{"count":5,"href":"https:\/\/www.msb365.blog\/index.php?rest_route=\/wp\/v2\/posts\/4862\/revisions"}],"predecessor-version":[{"id":4874,"href":"https:\/\/www.msb365.blog\/index.php?rest_route=\/wp\/v2\/posts\/4862\/revisions\/4874"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.msb365.blog\/index.php?rest_route=\/wp\/v2\/media\/4865"}],"wp:attachment":[{"href":"https:\/\/www.msb365.blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4862"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.msb365.blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4862"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.msb365.blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4862"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}