-
Notifications
You must be signed in to change notification settings - Fork 141
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
ADObjectPermissionEntry: Occasional error creating PSDrive #527
Comments
Hi @oWretch, the The problem is that the AD PSDrive is created when the |
@X-Guardian It is pretty consistent at present. Let me know what other logs you want me to gather etc to help track it down. I don’t have an issue with the AD drive loading if I manually load the module. |
Excellent, that should make life easier. Are you running your PowerShell session using the same credentials that you are specifying in the |
Assuming you are, lets try force-loading the PowerShell module when the |
Yes. |
When I add the |
I suspect the issue is that the AD module is still loaded, and it fails trying to load again. The modules I have loaded just before it tries to load the AD module are: Get-Module | Select-Object Name,Version
Name Version
---- -------
ActiveDirectory 1.0.0.0
Microsoft.PowerShell.Management 3.1.0.0
Microsoft.PowerShell.Security 3.0.0.0
Microsoft.PowerShell.Utility 3.1.0.0
Microsoft.WSMan.Management 3.0.0.0
MSFT_ADComputer 0.0
MSFT_ADObjectPermissionEntry 0.0 PSProviders: Get-PsProvider
Name Capabilities Drives
---- ------------ ------
Registry ShouldProcess, Transactions {HKLM, HKCU}
Alias ShouldProcess {Alias}
Environment ShouldProcess {Env}
FileSystem Filter, ShouldProcess, Credentials {C, D, E, F}
Function ShouldProcess {Function}
Variable ShouldProcess {Variable} PSDrives: Get-PSDrive
Name Provider
---- --------
Alias Alias
C FileSystem
Cert Certificate
D FileSystem
E FileSystem
Env Environment
F FileSystem
Function Function
HKCU Registry
HKLM Registry
Variable Variable
WSMan WSMan Interestingly, the AD Module is loaded but the AD drive is not available. |
Don't forget that the Dsc code is not running under your own user context, so modules you have loaded within your own PowerShell session have no bearing on Dsc, but what you are seeing there is likely to be the same scenario as what is happening when the Dsc runs. Interestingly, you don't even have the ActiveDirectory PSProvider loaded, so that it is the stage that is failing. |
I meant to include that those dumps are taken when DSC is running. I added the export commands to the |
OK, excellent. That proves it then. I've raised PR #528 to force load the |
Thanks @X-Guardian. That has solved the problem here. |
Excellent news. I'll get the PR review finished and then we can look at getting a new release published including this fix. |
When do you think it will be time to release this improvement? |
To be released, this module will have to be updated with the new release Pipeline automation. So hopefully before Xmas, depending on contributions. |
…ks (dsccommunity#528) - Changes to ADObjectPermissionEntry - Updated Assert-ADPSDrive with PSProvider Checks (issue dsccommunity#527).
Details of the scenario you tried and the problem that is occurring
As part of a full SQL Server AlwaysOn configuration, I am attempting to set the permissions on the AlwaysOn Listener computer object. Occasionally this will fail with the following error:
I am running the following modules:
ActiveDirectoryDsc: 4.2.0.0
ActiveDirectory: 1.0.0.0 (as ships with Server 2016 build 14393.2551)
This error only occurs with the
ADObjectPermissionEntry
resource, and not everytime I deploy and run the DSC configuration. But once the error occurs, it will always occur for everyADObjectPermissionEntry
resource, but other resources I am using (ADManagedServiceAccount
,ADServicePrincipalName
, andADComputer
) never fail with this issue.Verbose logs showing the problem
Suggested solution to the issue
The DSC configuration that is used to reproduce the issue (as detailed as possible)
Relevant section. The full DSC is much greater than this component.
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 ('dev' if using current dev branch)
4.2.0.0
The text was updated successfully, but these errors were encountered: