-
Notifications
You must be signed in to change notification settings - Fork 54
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
XDnsServerAdZone: Removing or Fixing Call to New-CimSession #53
Comments
|
@greggoindenver Do you have any ideas as to why a new-cimsession is being used in this dsc resource? |
|
@corydwood Maybe you could shed some light on this |
|
New-CimSession is being used to allow creating zones on remote DNS servers and/or using specific credentials for creating the zone on either the local server or a remote server. The code could be changed to only use New-CimSession if the ComputerName or Credential parameters are used. I can look into doing that, but may not be able to get to it for a few days. |
|
Also, it looks like #49 broke this resource as the Set-TargetResource function relies on the CimSession property being returned by the call to Get-TargetResource. |
|
@corydwood I might be able to get around to doing this as well.. Cannot promise anything depend on how my schedule goes. |
|
We have the same problem with version 1.8.0.0. Version 1.7.0.0 works fine. |
|
Has there been any further status on this issue? |
|
+1, same repro |
|
@corydwood, @TraGicCode : Have either of you been able to reproduce this error? I tried it again today on a different machine. I can create forward zones, but not reverse zones. |
|
I had the same issue "Cannot validate argument on parameter 'CimSession'" Should only add the CimSession parameter if the computername attribute was set on the resource. |
|
Update: This problem still exists. I've updated the following lines as a proposed solution: Also, under ($targetResource.Ensure -eq 'Present'): (Please forgive the formatting) |
|
@ejleroy your fix looks good. Are you going to create a pull request with it? |
|
Also, the $targetResource returned by Get-TargetResource doesn't actually include CimSession, so we should probably just create the CimSession if needed in the Set-TargetResource. Otherwise, as-is, the CimSessions are being created for each zone, but never being removed. |
|
Made some more changes based on your feedback. Going to test this out hopefully tomorrow and create a pull request if it looks okay. Basically, we'll only use CimSession (in Get and Set) if needed (based on if ComputerName is passed in) and remove any CimSessions created. `function Get-TargetResource }` `function Set-TargetResource }` |
|
@ejleroy Looks good. Looking forward to the PR |
|
@ejleroy Were you going to open up a PR for this? |
|
@greggoindenver I cannot create a forward or a reverse lookup zone still =[ |
|
I can confirm that the module still will not create AD-enabled zones. I just tested it about two weeks ago. |
|
@johlju , I'm cc'ing you on this to hopefully get some feedback on this before i dive in and start working on a PR to fix this issue.
Thanks. |
|
Would this have anything to do with the Kerberos double hop limitation?
Mark Braker
…________________________________
From: Michael Fyffe <notifications@github.com>
Sent: Sunday, February 4, 2018 6:20:05 PM
To: PowerShell/xDnsServer
Cc: Subscribed
Subject: Re: [PowerShell/xDnsServer] XDnsServerAdZone: Removing or Fixing Call to New-CimSession (#53)
@johlju<https://github.com/johlju> , I'm cc'ing you on this to hopefully get some feedback on this before i dive in and start working on a PR to fix this issue.
1. Is there an accepted pattern for having a surrogate node apply dsc configurations on itself that connect to some other node in which the resource should be managed? For example this module allows specifying credentials + computer name in which it will connect to and try and manage a xDnsServerAdZone resource. Id there any example in any known DSC Resources in the wild you know of that has this feature?
2. If using a CIMSession is considered acceptable then should it be returned from Get-TargetResource? Also what about the schema file as #44<#44> is attempting to do?
Thanks.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#53 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AMlUH4KB67VNh3sEw8TfNl2YQN4hoX3lks5tRjslgaJpZM4PTiYz>.
|
|
|
@TraGicCode to solve this issue, using Regarding that the target node connects to a different server. Normally I would expect this to be run on the DNS server itself, and there would be no need for a |
|
If there need to be a specific account that needs to be used to run the configuration then the built-in credential parameter |
|
@johlju I don't think this would be a breaking change since it was working previously and as pointed out #49 broke this unknowingly. The solution you are proposing i'm okay with implementing as it seems like the original author of this @corydwood was proposing the same solution. I do have a couple of more questions in the regards:
|
|
I asked the question before as well, the respons to my question was that if it is possible to keep WMF 4.0 support, then that would be a good thing, but it is not a requirement. In SqlServerDsc we are only supporting WMF 5.x since to support for WMF 4.0 would have been to much work. In SqlServerDsc we actually removed some WMF 4.0 support to remove technical debt and support more WMF 5.x scenarios (like support for built-in In this case, try to keep WMF 4.0 support if possible, but if that will result in more technical debt (new know issues that can't be solved) then I would say to remove WMF 4.0. But that would be a breaking change. At the end it's up to the DSC community, should we keep WMF 4.0 or not for this resource module? |
|
@greggoindenver @ejleroy @regedit32 Feel free to try my branch at #62 to verify this fixes your issues. |
- Fixed all PSSA rule warnings. - Changes to xDnsServerADZone - Fixed bug introduced by issue #49. Previously, CimSessions were always used regardless of connecting to a remote machine or the local machine. Now CimSessions are only utilized when a ComputerName, or ComputerName and Credential are used (issue #53).


Currently we only have winrm configured to listen on loopback ONLY with the following below settings
Unfortunately the XDnsServerAdZone DSC resource creates a new-cimsession in the Get-TargetResource function. This ends up resolving to the ip of the nic of the machine. Therefore the cimsession to connect will fail since it's not connecting VIA loopback address configured above for the winrm listener. Below is the error i'm getting
1.) Why is New-CimSession even needed here? can it be removed?
2.) If New-CimSession cannot be removed can we allow passing in of the ip to create the cimsession for?
The text was updated successfully, but these errors were encountered: