locked
Need help with script to create CAPs RRS feed

  • Question

  • Hello Everyone,

    I need some help perfecting a script for setting up common area phones.  The script uses a CSV file for information.  I recently added the ability to have columns for dial plan, voicepolicy, PIN and conferencing policy.

    What happens is that the script will create CAPs but once I step out of new-commonareaphone command-let it fails with no errors at all.   

    Source CSV

    DID   OU RegistrarPool DisplayName DisplayNumber Description  Email DialPlan VoicePolicy  PIN Extension
    11111111234

     OU=contacts,OU=ch,OU=ia,DC=ia-  global,DC=com


    dcs-lync-fe.ia-global.com Test 5 111.111.1234 Chicago Green Mill Conference room testcap5@interiorarchitects.com US-CA-SF US-West-International 123123 11234

    Script

    Import-CSV "caps.csv" | ForEach {
    $LineURI = 'tel:+' + $_.DID + ';ext=' + $_.Extension
    write-host $LineURI
    $SipAddress = 'sip:' + $_.Email
    Write-host $SipAddress
    New-CsCommonAreaPhone  -SipAddress $SipAddress -LineURI $LineURI -RegistrarPool $_.RegistrarPool -DisplayName $_.DisplayName -OU $_.OU -DisplayNumber $_.DisplayNumber -Description $_.Description
    Start-Sleep -s 30
    write-host $SipAddress
    Set-CsClientPin $SipAddress -PIN $_.PIN
    Grant-CsDialPlan -Identity $SipAddress -PolicyName $_.DialPlan
    Grant-CsVoicePolicy -Identity $SipAddress -PolicyName $_.VoicePolicy
    }

    Like i say it creates new CAPs with all parameters but just does not get voice policy, and dial plan.  All other information comes accoss,

    Any help would be much appreciated

    Thanks 

    Tuesday, June 25, 2013 12:07 AM

Answers

  • You can use commands Get-CsDialPlan and Get-CsVoicePolicy to check whether the plan and policy are assigned to specific user successfully.


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    • Proposed as answer by Lisa.zheng Wednesday, July 3, 2013 7:17 AM
    • Marked as answer by Lisa.zheng Thursday, July 4, 2013 10:46 AM
    Wednesday, June 26, 2013 2:17 AM

All replies

  • HI

    Check this It might Helpfull

    http://www.mikemattera.com/tools/

    http://www.minasi.com/forum/topic.asp?TOPIC_ID=40706

    http://gallery.technet.microsoft.com/scriptcenter/Lync-Common-Area-Phone-aed1a49f


    Whenever you see a helpful reply, click on Vote As Helpful & click on Mark As Answer if a post answers your question.

    Tuesday, June 25, 2013 6:37 AM
  • Is the Description field being read properly?

    Seeing those spaces makes me think that it is not going to pass through New-CsCommonAreaPhone 

    Try setting your csv file to read

    "Chicago Green Mill Conference room"

    instead of just

    Chicago Green Mill Conference room


    Have you visited Lync News lately? All of the latest Lync news, articles, and tips collected in one giant aggregator. http://lyncne.ws

    Tuesday, June 25, 2013 7:41 PM
  • You can use commands Get-CsDialPlan and Get-CsVoicePolicy to check whether the plan and policy are assigned to specific user successfully.


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    • Proposed as answer by Lisa.zheng Wednesday, July 3, 2013 7:17 AM
    • Marked as answer by Lisa.zheng Thursday, July 4, 2013 10:46 AM
    Wednesday, June 26, 2013 2:17 AM