New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TeamsChannel: System.Management.Automation.ParameterBindingValidationException: Cannot bind argument to parameter 'GroupId' because it is null. #3943
Comments
I have upgraded to 1.23.1122.1. This is still an issue. I also re-ran it with the "-Verbose" parameter but no additional useful information was recorded. VERBOSE: Dependencies were already successfully validated. |
@skghq Could you please check the output of Get-Team for any groups without a GroupId? Normally each group must have a valid Id, but your log says it is null for one of the groups and I cannot reproduce this in my environment. |
@malauter Minimally redacted:
|
|
@skghq The display name 'AR Team' is not unique, but this should not be a problem, this is why we are using the group id. I do not know why the group id could not be found during the export for one of your teams. |
@malauter It looks like I gave you bad information. Yes -- I just updated to the latest version and reproduced it. 'AR Team' actually exports fine. It is the next team that fails. If I look at the produced error log (Error Log created at {file://C:/temp/scott/debug/cwd/876-M365DSC-ErrorLog.log}) the last team is 'AR Team'. Looking at the console window the last team activity is for 'Evaluation Committee' Upgrade:
Console Output:
Get-Team:
Get-TeamChannel for 'Evaluation Committee' (NOT WORKING):
Get-TeamChannel for 'AR Team' (WORKING):
|
@malauter The "Membership Type" of private seems to stand out to me in the Get-TeamChannel output. |
@skghq Thanks for all the information. I have just created the same Team structure, even with a private channel, but still I cannot reproduce the issue. |
@malauter The script stops execution after the error so i'm not sure if that is the only team. I'll give debugging the script a go and let you know what I find. Any input on approaching this would be helpful. |
@malauter I found the problem. Bad information again. Using the stack trace of the error i modified your code. Stack trace:
I insert a line at 383 of MSFT_TeamsChannel.psm1:
I then imported the results of that to SQL:
'AR Team' and 'Evaluation Committee' are not at fault. See attached screenshot. I'm not sure how to go about providing you more information on this: |
I have no idea why there is this "NULL team" in your tenant. I think the only thing we can do is to adjust the code to skip the team if the GroupId is null. |
@skghq Could you please test if the adjusted code from the PR linked above solves your issue? |
Description of the issue
I will update to the latest version when I have a chance in a few days.
Command:
Export-M365DSCConfiguration -Components @("TeamsChannel") -Credential $Credential -Path $FilePath -FileName $FileName
Stack Trace:
[2023/11/23 09:30:53]
{InvalidData}
System.Management.Automation.ParameterBindingValidationException: Cannot bind argument to parameter 'GroupId' because it is null.
at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
"Error during Export:"
at Export-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.1115.1\DSCResources\MSFT_TeamsChannel\MSFT_TeamsChannel.psm1: line 388
at Start-M365DSCConfigurationExtract, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.1115.1\modules\M365DSCReverse.psm1: line 615
at Export-M365DSCConfiguration, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.1115.1\modules\M365DSCUtil.psm1: line 1320
at , C:\Scripts<<>>\Office365_Backup_Debug.ps1: line 5629
<<>>@<<>>.onmicrosoft.com
TenantId: <<>>.onmicrosoft.com
PS Output:
Transcript started, output file is C:\temp<<>>\debug\log\TeamsChannel.txt
Exporting Microsoft 365 configuration for Components: TeamsChannel
There is a newer version of the 'Microsoft365DSC' module available on the gallery.
To update the module and it's dependencies, run the following command:
Update-M365DSCModule
Authentication methods specified:
Connecting to {MicrosoftTeams}...✅
[1/1] Extracting [TeamsChannel] using {Credentials}...
<<< a lot of output>>>
❌
Error Log created at {file://C:/temp/<<>>/debug/cwd/5112-M365DSC-ErrorLog.log}
⌛ Export took {2232 seconds}
Transcript stopped, output file is C:\temp<<>>\debug\log\TeamsChannel.txt
Microsoft 365 DSC Version
1.23.1115.1
Which workloads are affected
Teams
The DSC configuration
Verbose logs showing the problem
Environment Information + PowerShell Version
The text was updated successfully, but these errors were encountered: