Author Posts

April 15, 2015 at 9:23 pm

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:
TollNumber:
ParticipantPasscode:
Domain:
Name:

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)

April 16, 2015 at 3:59 am

-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.

April 16, 2015 at 10:40 pm

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..

April 17, 2015 at 9:08 am

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 = @(
@{TollNumber=blah;ParticipantCode=blah;Domain=blah;Name=blah}
@{TollNumber=blah;ParticipantCode=blah;Domain=blah;Name=blah}
)