You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Details of the scenario you tried and the problem that is occurring
Using xRDServer ressource to add an RDS-Web-Access server raises exceptions but works anyway.
Verbose logs showing the problem
{
"Exception": {
"Message": "The PowerShell DSC resource \u0027[xRDServer]AddWebServer02\u0027 with SourceInfo \u0027::179::9::xRDServer\u0027 threw one or more non-terminating errors while running the Set-TargetResource functionality. These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational. Refer to this channel for more details.",
"Data": {
},
"InnerException": {
"SerializedRemoteException": "System.Management.Automation.CommandNotFoundException: The term \u0027Get-RDWorkspace\u0027 is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.\r\n at System.Management.Automation.CommandDiscovery.LookupCommandInfo(String commandName, CommandTypes commandTypes, SearchResolutionOptions searchResolutionOptions, CommandOrigin commandOrigin, ExecutionContext context)\r\n at System.Management.Automation.CommandDiscovery.LookupCommandProcessor(String commandName, CommandOrigin commandOrigin, Nullable`1 useLocalScope)\r\n at System.Management.Automation.ExecutionContext.CreateCommand(String command, Boolean dotSource)\r\n at System.Management.Automation.PipelineOps.AddCommand(PipelineProcessor pipe, CommandParameterInternal[] commandElements, CommandBaseAst commandBaseAst, CommandRedirection[] redirections, ExecutionContext context)\r\n at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)\r\n at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)\r\n at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)\r\n at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)",
"SerializedRemoteInvocationInfo": "System.Management.Automation.InvocationInfo",
"ErrorRecord": "The term \u0027Get-RDWorkspace\u0027 is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.",
"WasThrownFromThrowStatement": false,
"Message": "The term \u0027Get-RDWorkspace\u0027 is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.",
"Data": "System.Collections.ListDictionaryInternal",
"InnerException": null,
"TargetSite": null,
"StackTrace": null,
"HelpLink": null,
"Source": null,
"HResult": -2146233087
},
"TargetSite": null,
"StackTrace": null,
"HelpLink": null,
"Source": null,
"HResult": -2146233079
},
"TargetObject": null,
"CategoryInfo": {
"Category": 7,
"Activity": "",
"Reason": "InvalidOperationException",
"TargetName": "",
"TargetType": ""
},
"FullyQualifiedErrorId": "NonTerminatingErrorFromProvider",
"ErrorDetails": null,
"InvocationInfo": null,
"ScriptStackTrace": null,
"PipelineIterationInfo": [
]
}
Suggested solution to the issue
I found a workaround by adding a reboot if Add-RDServer fails. This is not a ideal solution as it could result in an infinite loop, but it does the job for me right now.
xRDSessionDeployment RDDeployment
{
ConnectionBroker =$MainConnectionBroker
WebAccessServer =$WebAccessServer1
SessionHost =$SessionHost
PsDscRunAsCredential =$AdminCreds
DependsOn ="[xDSCDomainjoin]JoinDomain"
}
Script AddWebServer02 {
GetScript = { @{} } # not used
SetScript = {
try {
Import-Module RemoteDesktop
Add-RDServer-Server $Using:WebAccessServer2-Role 'RDS-Web-Access'-ConnectionBroker $Using:ConnectionBroker
}
catch {
# The function throws an exception but still works
}
}
TestScript = {
Import-Module RemoteDesktop
$servers=Get-RDServer-Role 'RDS-Web-Access'-ConnectionBroker $Using:MainConnectionBroker-ErrorAction SilentlyContinue
if ($servers-and$Using:WebAccessServer2-in$servers.Server) { return$true } else { return$false }
}
PsDscRunAsCredential =$AdminCreds
DependsOn ="[xRDSessionDeployment]RDDeployment"
}
The DSC configuration that is used to reproduce the issue (as detailed as possible)
Details of the scenario you tried and the problem that is occurring
Using xRDServer ressource to add an RDS-Web-Access server raises exceptions but works anyway.
Verbose logs showing the problem
Suggested solution to the issue
I found a workaround by adding a reboot if Add-RDServer fails. This is not a ideal solution as it could result in an infinite loop, but it does the job for me right now.
The DSC configuration that is used to reproduce the issue (as detailed as possible)
The operating system the target node is running
Version and build of PowerShell the target node is running
Version of the DSC module that was used
2.0.0
The text was updated successfully, but these errors were encountered: