dbatools
dbatools copied to clipboard
New-DbaAgentSchedule contained AG fails: "value cannot be null. parameter name: newParent"
Verified issue does not already exist?
I have searched and found no existing issue
What error did you receive?
When trying to create a new agent job on contained availability groups using new-dbaagentSchedule we encountered a weird error:
Warning [16:02:15][New-DbaAgentSchedule] something went wrong adding the schedule. | Value cannot be null Parameter name: newParent This seems to happen in every agent related command on contained availability groups.
Steps to Reproduce
# provide your command(s) executed pertaining to dbatools
# please include variable values (redacted or fake if needed) for reference
Create a contained availability group with a listener
Run New-DbaAgentSchedule -SqlInstance 'listener' -Schedule name -Force
Please confirm that you are running the most recent version of dbatools
Can confirm I'm running dbatools 2.1.26
Other details or mentions
No response
What PowerShell host was used when producing this error
Windows PowerShell (powershell.exe)
PowerShell Host Version
Name Value
PSVersion 5.1.20348.2031
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.20348.2031
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
SQL Server Edition and Build number
Microsoft SQL Server 2022 (RTM-CU14) (KB5038325) - 16.0.4135.4 (X64) Jul 10 2024 14:09:09 Copyright (C) 2022 Microsoft Corporation Enterprise Edition (64-bit) on Windows Server 2022 Datacenter 10.0 <X64> (Build 20348: ) (Hypervisor)
.NET Framework Version
4.8.04161