Giter VIP home page Giter VIP logo

TeamsTeam: ParameterBindingValidationException: Cannot validate argument on parameter 'DisplayName'. The character length (0) of the argument is too short. Specify an argument with a length that is greater than or equal to "1", and then try the command again. about microsoft365dsc HOT 13 CLOSED

skghq avatar skghq commented on July 20, 2024
TeamsTeam: ParameterBindingValidationException: Cannot validate argument on parameter 'DisplayName'. The character length (0) of the argument is too short. Specify an argument with a length that is greater than or equal to "1", and then try the command again.

from microsoft365dsc.

Comments (13)

malauter avatar malauter commented on July 20, 2024

How could you create Teams without a display name? A display name is required during creation. So, even if we would adjust the DSC resource to allow the export of Teams with a blank display name, we could not use it for importing it again.

from microsoft365dsc.

skghq avatar skghq commented on July 20, 2024

@malauter I haven't a clue... but somehow it is in my tenant configuration...

from microsoft365dsc.

skghq avatar skghq commented on July 20, 2024

@malauter Found the problem:

I ran:
`$t = Get-Team

$t | Select GroupId,InternalId,DisplayName,Visibility,MailNickName,Classification,Archived,AllowGiphy,GiphyContentRating,AllowStickersAndMemes,AllowCustomMemes,AllowGuestCreateUpdateChannels,AllowGuestDeleteChannels,AllowCreateUpdateChannels,AllowCreatePrivateChannels,AllowDeleteChannels,AllowAddRemoveApps,AllowCreateUpdateRemoveTabs,AllowCreateUpdateRemoveConnectors,AllowUserEditMessages,AllowUserDeleteMessages,AllowOwnerDeleteMessages,AllowTeamMentions,AllowChannelMentions,ShowInTeamsSearchAndSuggestions |
Export-Csv -NoTypeInformation -delimiter "t" C:\ETL\teams.csv

Upon inspecting the exported file I had 1 entirely blank row. When I went back through the PowerShell output I see this in the output where I have the blank row:

Error retrieving Team with GroupId [abc-1-2-3]. ErrorCode: [NotFound]. ErrorMessage: No team found with Group Id abc-1-2-3

This appears to be a problem with the Get-Team command

from microsoft365dsc.

malauter avatar malauter commented on July 20, 2024

@skghq If you run this command for problematic team, is $x equal $null afterwards?
$x = Get-Team -GroupID abc-1-2-3
$x -eq $null

from microsoft365dsc.

skghq avatar skghq commented on July 20, 2024

@malauter:

PS C:\temp\scott\DebugTeam\cwd> $x = Get-Team -GroupID abc-1-2-3
PS C:\temp\scott\DebugTeam\cwd> $x -eq $null
True

from microsoft365dsc.

skghq avatar skghq commented on July 20, 2024

teamsteam2

from microsoft365dsc.

malauter avatar malauter commented on July 20, 2024

@skghq Thanks! I will adjust the resource to skip such Teams during export.

from microsoft365dsc.

ricmestre avatar ricmestre commented on July 20, 2024

@malauter This topic keeps being brought and it seems there's different opinions on how to solve it. I already had issues in the past with Intune role assignments and this morning with a customer also a problem with a Teams group assignment where the group is essentially deleted and/or orphaned, but the times I've seen reported here these kind of issues the reply was that it should be dealt with MS support instead of changing the code.

Has this opinion changed in the meantime? If yes there are other places where this problem occurs, such as the examples I gave above, and that will need the code changed to cope with this kind of problem.

from microsoft365dsc.

skghq avatar skghq commented on July 20, 2024

@malauter One more interesting item to note... I consistently get failures for "abc-1-2-3" ... I don't know where it's pulling the GroupId from if it doesn't have a team? I'll look in to it.

What I'm randomly getting when running Get-Team is this:

Error retrieving Team with GroupId [def-9-8-7]. ErrorCode: [BadGateway]. ErrorMessage: Failed to execute backend request.

This might be a throttling issue.

from microsoft365dsc.

malauter avatar malauter commented on July 20, 2024

@ricmestre It is just my personal opinion, but in this case the Export method cannot even call the Get method, because we have a validation of the display name length (min length = 1) in the Get function. This is why we see this error. To handle this, I would only call the Get method if there is a display name.
This is just my opinion. I will create a PR and then let's see if it will be approved.

from microsoft365dsc.

ricmestre avatar ricmestre commented on July 20, 2024

OK, let's wait and see what's their opinion on this, but see below, the export during TeamsGroupPolicyAssignment is trying to deserialize the DisplayName of $Group[0] but if it's $null, such as a deleted group like I explained one of my customers has, then the export of that resource stops completely. Fortunately in this case it just missed an additional assignment and not dozens or hundreds, in the meantime they raised a ticket with MS support to sort the deletion of that specific assignment since they are not able to do it due to an error being caused by that deleted group.

from microsoft365dsc.

malauter avatar malauter commented on July 20, 2024

@ricmestre Is there a Github issue for this? I think we should not mix similar issues for different resources here.

from microsoft365dsc.

ricmestre avatar ricmestre commented on July 20, 2024

I'm not mixing, I'm giving an example where the same type of issue happens on another resource. I didn't raise PRs to fix those issues myself for similar cases on other resources because like I said in the past the reply I got was that I had to solve the issue in the tenant instead of changing the code.

from microsoft365dsc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.