locked
Enable Bullk Lync Users for Enterprise Voice RRS feed

  • Question

  • How can i enable multiple users for enterprise voice including assigning lineuri based on company standard tel and ext, dial plan policy, voice policy, persistent chat policy and client policy using powershell script? I can export the list of users who are not enabled for enterprise voice to a csv file which includes the tel and ext. Now, i want to use the content of the csv file to enable the users for enterprise voice and assigning the correct policy based on location or dial plan policy. appreciate if anyone can share some useful information or actual script. thanks
    Wednesday, August 23, 2017 7:46 AM

Answers

  • You could write your own too, something like this:

    You could create a CSV like this:

     Identity,LineURI,DialPlan,VoicePolicy 

    User1,tel:+15556667777,MainDialPlan,MainVoicePolicy 

    User2,tel:+15557778888,BranchDialPlan,BranchVoicePolicy



    Then have a script like this, add as many policies as you'd like

    $UserList = Import-Csv userlist.txt 

    ForEach ($item in $UserList){  

    Identity = $($item.identity) 

    $LineURI = $($item.lineuri) 

    $DialPlan = $($item.dialplan) 

    $VoicePolicy = $($item.voicepolicy)

    set-csuser -identity $identity -lineuri $lineuri 

    grant-csdialplan -identity $identity -policy $DialPlan 

    grant-csvoicepolicy -identity $identity -policy $VoicePolicy

    }




    Please remember, if you see a post that helped you please click "Vote" on the left side of the response, and if it answered your question please click "Mark As Answer". SWC Unified Communications This forum post is based upon my personal experience and does not necessarily reflect the opinion or view of Microsoft, SWC, their employees, or other MVPs.


    Wednesday, August 23, 2017 3:49 PM
  • Hi ddrodiano,

    Are there any update for this issue, if the reply is helpful to you, please try to mark it as an answer, it will help others who has similar issue.


    Best Regards,

    Leon-Lu
    TechNet Community Support


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    • Marked as answer by ddrodiano Tuesday, September 5, 2017 7:00 AM
    Monday, August 28, 2017 9:21 AM

All replies

  • Hi,

    There are a plethora of scripts out there from basic to advanced that allow for bulk enablement, no need to reinvent the wheel here; pick a simple one like Mark Vales Enable Bulk Users script and modify it accordingly.

    The content of the script is basic 'For Each' cycling, so if there's anything you don't want you can take it out, and  if there's anything extra you need, simply add a section to the script and reference the relevant column in your CSV.

    Your best of grabbing something like this that meets 80% of your requirements and taking care of the other 20% yourself, if someone posts code you risk a to-and-fro tennis match in the forums - I guarantee it.

    Kind regards
    Ben


    Note: If you find a post informative, please mark it so using the arrow to the left. If it answers a question you've asked, please mark the thread as answered to aid others when they're looking for solutions to similar problems.

    Wednesday, August 23, 2017 8:36 AM
  • You could write your own too, something like this:

    You could create a CSV like this:

     Identity,LineURI,DialPlan,VoicePolicy 

    User1,tel:+15556667777,MainDialPlan,MainVoicePolicy 

    User2,tel:+15557778888,BranchDialPlan,BranchVoicePolicy



    Then have a script like this, add as many policies as you'd like

    $UserList = Import-Csv userlist.txt 

    ForEach ($item in $UserList){  

    Identity = $($item.identity) 

    $LineURI = $($item.lineuri) 

    $DialPlan = $($item.dialplan) 

    $VoicePolicy = $($item.voicepolicy)

    set-csuser -identity $identity -lineuri $lineuri 

    grant-csdialplan -identity $identity -policy $DialPlan 

    grant-csvoicepolicy -identity $identity -policy $VoicePolicy

    }




    Please remember, if you see a post that helped you please click "Vote" on the left side of the response, and if it answered your question please click "Mark As Answer". SWC Unified Communications This forum post is based upon my personal experience and does not necessarily reflect the opinion or view of Microsoft, SWC, their employees, or other MVPs.


    Wednesday, August 23, 2017 3:49 PM
  • hi Anthony. this is really helpful. what i need now is to manipulate the telephone number from the csv file and strip the first few numbers so that i only have the last five. this is our standard for lineuri. appreciate if you can point me to the right direction. thanks
    Thursday, August 24, 2017 7:04 AM
  • It'd be easier to do that with an excel formula against the CSV prior to import rather than in the script no?

    Incidentally, you shouldn't be giving people 5 digit line URI's in Skype for Business as it's considered extremely bad practice. Enterprise voice users should all have full E.164 formatted numbers. You should then be using phone book normalisation rules and dial plans to compensate for any 5 digit dialling habits or presentations. It's worth considering this point as it's a lot of time and effort to re-do a number formatting strategy once you've rolled out your EV users.

    Happy to answer any scenario based questions you might have around the E.164 practice.

    Kind regards
    Ben


    Note: If you find a post informative, please mark it so using the arrow to the left. If it answers a question you've asked, please mark the thread as answered to aid others when they're looking for solutions to similar problems.

    Thursday, August 24, 2017 8:19 AM
  • I agree with Ben here, try to stick to E.164 format in Skype, and convert it on the way out if needed, anything else is bad practice.  If you must do it, it's easier in the CSV often, if you need to do it in PowerShell, add the last line in the snippet below right after the $LineURI = line in the code.

    $LineURI = $($item.lineuri) 

    $LineURI. = $LineUri.substring($LineUri.length - 5, 5)



    Please remember, if you see a post that helped you please click "Vote" on the left side of the response, and if it answered your question please click "Mark As Answer". SWC Unified Communications This forum post is based upon my personal experience and does not necessarily reflect the opinion or view of Microsoft, SWC, their employees, or other MVPs.

    Thursday, August 24, 2017 4:20 PM
  • Hi ddrodiano,

    Are there any update for this issue, if the reply is helpful to you, please try to mark it as an answer, it will help others who has similar issue.


    Best Regards,

    Leon-Lu
    TechNet Community Support


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    • Marked as answer by ddrodiano Tuesday, September 5, 2017 7:00 AM
    Monday, August 28, 2017 9:21 AM