BNWEIN / CIPPAPIModule

A PowerShell Module for the CIPP API
GNU Affero General Public License v3.0
10 stars 2 forks source link

Get-CIPPTeamsVoice not working? #3

Closed CDSFounder closed 3 weeks ago

CDSFounder commented 3 weeks ago

Hello, first off - this module is SUPER cool. Thanks so much for investing the time to make this.

I noticed when using it today that the command Get-CIPPTeamsVoice does not work on any of our managed tenants.

At first, we were getting: "Invoke-RestMethod: [ "The property \u0027AcquisitionDate\u0027 cannot be found on this object. Verify that the property exists and can be set." ]"

After a few attempts, now we get: "Invoke-RestMethod: [ "Failed to make Teams API Get Request Response status code does not indicate success: 404 (Not Found)." ]"

I have also tried: invoke-CIPPRestMethod -Endpoint '/api/listteamsvoice' -Method GET -Params @{ 'tenantfilter' = "xxxxxxxx" } same result.

Perhaps this error is thrown from the CIPP API itself?

Our intended goal is to get a list of available Teams Voice phone numbers. Would love any thoughts or ideas you may have!

BNWEIN commented 3 weeks ago

Good morning.

Your first error:

[ "The property \u0027AcquisitionDate\u0027 cannot be found on this object. Verify that the property exists and can be set." ]"

Would suggest you are not getting a token. My guess is your CIPP API is not working at all. Have you tried other commands?

Did you follow CIPP's setup guide for the API in full?

I tested this my end, and both:

 Get-CIPPTeamsVoice -CustomerTenantID contoso.onmicrosoft.com

and

invoke-CIPPRestMethod -Endpoint '/api/listteamsvoice' -Method GET -Params @{ 'tenantfilter' = "contoso.onmicrosoft.com" }

Commands worked first time.

Questions

1: Are you using the latest version of the module? (1.1.0) 2: What happens when you try "Get-CIPPLogs"

CDSFounder commented 3 weeks ago

Hello,

I am using the tenant ID as labeled in Entra ID (a GUID) and not the domain. I tried the friendly Entra ID domain name as well. It does not give an error with the domain, but also doesn't do anything.

  1. Yes, I am using the latest version.
  2. Get-CIPPLogs and other CIPP commands (Get-CIPPMailboxes, Get-CIPPTenants etc.) all work fine. Not sure why Get-CIPPTeamsVoice does not work.
  3. Yes, I followed the guide.

EDIT: I see what's going on now, the command Get-CIPPTeamsVoice does indeed work if you pass the Entra ID domain name, but it does not work if you pass the GUID. When I tested with the domain name only a few moments ago it was for a client that did not use Teams voice, which is why it returned nothing. :p

Either way, I think it should also work with the Entra ID tenant ID (GUID) right?

BNWEIN commented 3 weeks ago

Not all CIPP Commands are built to accept both the Tenant ID and the Tenant Default Domain. For it to accept both requires a change on the CIPP Backend rather than the module.

With this in mind i am going to close this bug, but do feel free to open a Feature Request/Bug on CIPP Its self about making it so the /listteamsvoice can accept both TenantID and Default Domain name.

I have however updated the docs (In Dev) to show that this requires the default domain name.