Skip to content
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

xGroupSet resource throws errr #756

Open
shreddy99 opened this issue Nov 2, 2022 · 0 comments
Open

xGroupSet resource throws errr #756

shreddy99 opened this issue Nov 2, 2022 · 0 comments

Comments

@shreddy99
Copy link

Problem description

Can someone help with the below error for xGroupSet ?

"PowerShell DSC resource DSC_xGroupResource failed to execute Set-TargetResource functionality with error message: Exception calling "Save" with "0" argument(s): "An unknown directory user object was requested\r\n" ",

Verbose logs

{
    "Exception":  {
                      "Message":  "PowerShell DSC resource DSC_xGroupResource  failed to execute Set-TargetResource functionality with error message: Exception calling \"Save\" with \"0\" argument(s): \"An unknown directory user object was requested\r\n\" ",
                      "Data":  {

                               },
                      "InnerException":  {
                                             "ErrorRecord":  "Exception calling \"Save\" with \"0\" argument(s): \"An unknown directory user object was requested\r\n\"",
                                             "WasThrownFromThrowStatement":  false,
                                             "Message":  "Exception calling \"Save\" with \"0\" argument(s): \"An unknown directory user object was requested\r\n\"",
                                             "Data":  "System.Collections.ListDictionaryInternal",
                                             "InnerException":  "System.Management.Automation.MethodInvocationException: Exception calling \"Save\" with \"0\" argument(s): \"An unknown directory user object was requested\r\n\" ---\u003e System.DirectoryServices.AccountManagement.PrincipalOperationException: An unknown directory user object was requested\r\n ---\u003e System.Runtime.InteropServices.COMException: An unknown directory user object was requested\r\n\r\n   at System.DirectoryServices.AccountManagement.UnsafeNativeMethods.IADsGroup.Add(String bstrNewItem)\r\n   at System.DirectoryServices.AccountManagement.SAMStoreCtx.UpdateGroupMembership(Principal group, DirectoryEntry de, NetCred credentials, AuthenticationTypes authTypes)\r\n   --- End of inner exception stack trace ---\r\n   at System.DirectoryServices.AccountManagement.SAMStoreCtx.UpdateGroupMembership(Principal group, DirectoryEntry de, NetCred credentials, AuthenticationTypes authTypes)\r\n   at System.DirectoryServices.AccountManagement.SDSUtils.ApplyChangesToDirectory(Principal p, StoreCtx storeCtx, GroupMembershipUpdater updateGroupMembership, NetCred credentials, AuthenticationTypes authTypes)\r\n   at System.DirectoryServices.AccountManagement.SAMStoreCtx.Update(Principal p)\r\n   at CallSite.Target(Closure , CallSite , Object )\r\n   --- End of inner exception stack trace ---\r\n   at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)\r\n   at System.Management.Automation.Interpreter.ActionCallInstruction`2.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)\r\n   at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame)\r\n   at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0)\r\n   at System.Management.Automation.PSScriptCmdlet.RunClause(Action`1 clause, Object dollarUnderbar, Object inputToProcess)\r\n   at System.Management.Automation.PSScriptCmdlet.DoEndProcessing()\r\n   at System.Management.Automation.CommandProcessorBase.Complete()",
                                             "TargetSite":  "System.Collections.ObjectModel.Collection`1[System.Management.Automation.PSObject] Invoke(System.Collections.IEnumerable)",
                                             "StackTrace":  "   at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)\r\n   at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)\r\n   at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)\r\n   at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)\r\n   at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)\r\n   at System.Management.Automation.PowerShell.Invoke(IEnumerable input, PSInvocationSettings settings)\r\n   at Microsoft.PowerShell.DesiredStateConfiguration.Internal.ResourceProviderAdapter.ExecuteCommand(PowerShell powerShell, ResourceModuleInfo resInfo, String operationCmd, List`1 acceptedProperties, CimInstance nonResourcePropeties, CimInstance resourceConfiguration, LCMDebugMode debugMode, PSInvocationSettings pSInvocationSettings, UInt32\u0026 resultStatusHandle, Collection`1\u0026 result, ErrorRecord\u0026 errorRecord, PSModuleInfo localRunSpaceModuleInfo)",
                                             "HelpLink":  null,
                                             "Source":  "System.Management.Automation",
                                             "HResult":  -2146233087
                                         },
                      "TargetSite":  null,
                      "StackTrace":  null,
                      "HelpLink":  null,
                      "Source":  null,
                      "HResult":  -2146233079
                  },
    "TargetObject":  null,
    "CategoryInfo":  {
                         "Category":  7,
                         "Activity":  "",
                         "Reason":  "InvalidOperationException",
                         "TargetName":  "",
                         "TargetType":  ""
                     },
    "FullyQualifiedErrorId":  "ProviderOperationExecutionFailure",
    "ErrorDetails":  null,
    "InvocationInfo":  null,
    "ScriptStackTrace":  null,
    "PipelineIterationInfo":  [

                              ]

DSC configuration

My configuration as below: 

    xUser Admin'
    {
      Ensure = 'Present'
      UserName = 'sa_admin'
      Password = $Credential
      FullName = 'SA Team Admin'
      Description = 'Service Account for SA purposes'
      PasswordChangeRequired = $true
    }
    
    xGroupSet 'AddMembers'
    {
      GroupName = `@('${sa_group_membership_name}')`
      Ensure = 'Present'
      MembersToInclude = 'sa_admin'
    }

Suggested solution

n/a

Operating system the target node is running

Windows Server 2019 Datacenter

PowerShell version and build the target node is running

5.1.17763.2931

xPSDesiredStateConfiguration version

xPSDesiredStateConfiguration 9.1.0   C:\Program Files\WindowsPowerShell\Modules\xPSDesiredStateConfiguration\9.1.0\x...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant