Remove tollfreeNumber from multiple users

This topic contains 3 replies, has 3 voices, and was last updated by Profile photo of Rob Simmers Rob Simmers 1 year, 6 months ago.

  • Author
  • #24315
    Profile photo of Jussi

    Hello forum,

    I have users in Lync Online and I need to remove the toll-free number from all of the users. I have ran command

    Get-CsUserAcp | Where-Object {$_.AcpInfo -match "PGI"} which gives me the users I need to remove the number from.

    When I tested this on my lab, I tried to remove the tollFreeNumber by:

    Get-CsUserAcp -Identity test.user | Set-CsUserAcp -TollFreeNumbers $null

    Now when I issued that command, console prompted the following:
    Supply values for the following parameters:

    So if those parameters are mandatory when using Set-CsUserAcp, and all of my users have unique passcodes, it seems that there is no way to remove the toll-free numbers from all the users with just one command?

    Does anyone know if this can be done easily or am I forced to just go to the Office365 portal and go through all of the users (many hundreds)

  • #24334
    Profile photo of Don Jones
    Don Jones

    -TollFreeNumbers isn't mandatory, but if you specify it, you have to provide a value. The help file suggests it wants an array, so you might try:

    -TollFreeNumbers @()

    Which is an empty array. That's not the same thing as $null.

  • #24381
    Profile photo of Jussi

    Hello Don,

    Thanks for your reply. The tollFreeNumber is not the problem, the passcode number is as it is unique to all the users.
    I think I'd have to do some kind of scripting and as that is not my strongest suit (and I do not the time at this moment to learn) I think I'm forced to remove these one by one from GUI..

  • #24420
    Profile photo of Rob Simmers
    Rob Simmers

    Did you event try what Don suggested? It looks like the TollFreeNumbers is an array of objects containing the TollNumber, ParticipantCode, Domain and Name. If you do:

     Get-CsUserAcp -Identity test.user | Select TollFreeNumbers

    I would expect it would return @{TollNumber=blah;ParticipantCode=blah;Domain=blah;Name=blah} for an object that contains a ParticipantCode. What is returned for a user that has no ParticipantCode? Setting it to @() should set the array of objects to nothing and remove an entries, visually it would look something like this

    $TollFreeNumber = @(

You must be logged in to reply to this topic.