locked
Granting Voice Users PSTN Access Between WOrking Hours ? RRS feed

  • Question

  • hi All,

    one of our Customers asked me this simple Question and i couldn't give them a clear answer !

    how can we  manage PSTN Access of Voice Enabled Users between Time Periods ? is that possible at all ?

    for example i want to restrict one user from accessing PSTN Lines after 17:00 and that user has Analog phone joined by a gateway to Lync environment.

    Regards

    Friday, October 19, 2012 12:33 PM

Answers

  • If it's just one user, an easier way might be to:

    Create 2 voice policies. 1 with PSTN access and 1 without.

    Set up a PowerShell script that flips the user's voice policy at specific times of day via Grant-CsVoicePolicy.

    The change will be picked up by the server dynamically without a user sign out since the device is analog.

    • Proposed as answer by Ruben Nauwelaers Friday, October 19, 2012 8:34 PM
    • Marked as answer by Kent-Huang Tuesday, October 30, 2012 8:51 AM
    Friday, October 19, 2012 3:18 PM
  • Hi,

    You can refer to the following script. It only assign the policy to multiple users. I just test it by manually running this script. It assigned the policy to multiple users successfully. You may need to use schedule task to run the powershell at particular time. You can create two powershell script files that assigning different voice policies.

    ------------------------------------

    $importedusers = import-csv c:\script\test2.csv

    $transcriptname = "grantpolicies" + (Get-Date -format s).replace(":","-")+".txt"start-transcript $transcriptname

    foreach($importeduser in $importedusers)

    {

    grant-csvoicepolicy -identity $importeduser.sipuri -policyname $importeduser.voicepolicy -verbose

    }

    stop-transcript

    ---------------------------------------------

    Please create csv file as below:

    sipuri    voicepolicy

    sip:1user@domain.com  TestPolicy1

    sip:2user@domain.com  TestPolicy1


    Regards,

    Kent Huang

    TechNet Community Support ************************************************************************************************************************ 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.


    • Edited by Kent-Huang Monday, October 22, 2012 6:46 AM
    • Marked as answer by Kent-Huang Tuesday, October 30, 2012 8:51 AM
    Monday, October 22, 2012 6:46 AM

All replies

  • There is no way to do this natively in Lync. However, it should be possible to create this "Time of Day" functionality using scripts.
    Friday, October 19, 2012 12:58 PM
  • I agree with ALANMAD. The only way to accomplish this would be with MSPL and the Lync Server SDK.

    http://msdn.microsoft.com/en-us/library/lync/hh364822.aspx

    Friday, October 19, 2012 1:12 PM
  • If it's just one user, an easier way might be to:

    Create 2 voice policies. 1 with PSTN access and 1 without.

    Set up a PowerShell script that flips the user's voice policy at specific times of day via Grant-CsVoicePolicy.

    The change will be picked up by the server dynamically without a user sign out since the device is analog.

    • Proposed as answer by Ruben Nauwelaers Friday, October 19, 2012 8:34 PM
    • Marked as answer by Kent-Huang Tuesday, October 30, 2012 8:51 AM
    Friday, October 19, 2012 3:18 PM
  • thanks all of you guys

    this is helpfull to have PS flipping access by script .but i am not familiar with PS enough .may you help me abit on this ?

     what about if user is not only analog line user ? if the user is PC or IP Phone... does this affect ?

    Saturday, October 20, 2012 8:27 AM
  • Hi,

    You can refer to the following script. It only assign the policy to multiple users. I just test it by manually running this script. It assigned the policy to multiple users successfully. You may need to use schedule task to run the powershell at particular time. You can create two powershell script files that assigning different voice policies.

    ------------------------------------

    $importedusers = import-csv c:\script\test2.csv

    $transcriptname = "grantpolicies" + (Get-Date -format s).replace(":","-")+".txt"start-transcript $transcriptname

    foreach($importeduser in $importedusers)

    {

    grant-csvoicepolicy -identity $importeduser.sipuri -policyname $importeduser.voicepolicy -verbose

    }

    stop-transcript

    ---------------------------------------------

    Please create csv file as below:

    sipuri    voicepolicy

    sip:1user@domain.com  TestPolicy1

    sip:2user@domain.com  TestPolicy1


    Regards,

    Kent Huang

    TechNet Community Support ************************************************************************************************************************ 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.


    • Edited by Kent-Huang Monday, October 22, 2012 6:46 AM
    • Marked as answer by Kent-Huang Tuesday, October 30, 2012 8:51 AM
    Monday, October 22, 2012 6:46 AM
  • hi Kent

    i used the script and had some issues

    first naming part was not working properly,but i fixed them all and getting logs simply

    second is about Identity Switch inside grant-csvoicepolicy . it says : Grant-CsVoicePolicy : Cannot bind argument to parameter 'Identity' because it i
    s null.

    i used below CSV File :

    sipuri    voicepolicy

    sip:ravaghi@domain.com    pstnaccess

    may you help me ?

    Regards

    Tuesday, October 23, 2012 7:42 AM
  • Hi,

    I also encountered this message when first testing it. You can try to copy the following context into Notepad and then change file format to csv.

    sipuri,voicepolicy

    sip:ravaghi@domain.com,”pstnaccess”

    sip:testuse@domain.com,”pstnaccess”


    Regards,

    Kent Huang

    TechNet Community Support ************************************************************************************************************************ 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.


    • Edited by Kent-Huang Monday, October 29, 2012 3:02 AM
    Monday, October 29, 2012 3:02 AM