I am using xGroup because I have to add members to the local group that are in a different, trusted domain.
If I use the property Members I get an error:
[xGroup]Performance_Log_Users
D:\Scripts\iAPPWebRole.ps1::358::3::xGroup
The PowerShell provider MSFT_xGroupResource threw one or more non-terminating errors while running the Test-TargetResource functionality.
These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational. Refer to this channel for more details.
If I use MembersToInclude with the same members, everything works fine.
Perhaps I am missing something here or there is a bug.
I also notice that the first time through a new configuration xGroup errors complaining that there is no such object as the Group I am trying to create. If I run it again or create the groups manually before I run my script, everything works as long as I use MembersToInclude.
There isn’t a community version yet but I took the liberty to fork the cPSDesiredStateConfiguration and add the cGroup resource.
I’ve fixed the bug causing errors when a group is created but I wasn’t able to reproduce the problem using Members. This is how I wrote the configuration:
On the next row (169), $Group is added to $Disposables.
Later on when each item in $Disposables are disposed (row 436), the null value will result in an error stating “You cannot call a method on a null-valued expression.”
The cGroup resource checks if $Group -ne $null Before adding it to $disposables.
This change should fix the errors generated the first time a configuration runs (when the Group is created).
Regarding your problem with using Members vs MembersToInclude I could not test the scenario since I do not have a trusted domain in my lab.
I’ve got a problem adding a domain user to a local group, the error is “Network Path Not Found” and happens for a short time after the computer joins the domain, but works sometime afterwards.
Still narrowing it down, but grabbing a coffee then rebooting the computer works for now.
I also tried it with @( “trusted\production admins”) both with members and MembersToInclude
Here is what I get:
VERBOSE: [FPKDSCSCRUBBER1]: LCM: [ Start Test ] [[xGroup]wm_rsc_shr_webimport_full]
VERBOSE: [FPKDSCSCRUBBER1]: [[xGroup]wm_rsc_shr_webimport_full] A group with the name
wm_rsc_shr_webimport_full exists.
You cannot call a method on a null-valued expression.
+ CategoryInfo : InvalidOperation: ( , CimException
+ FullyQualifiedErrorId : InvokeMethodOnNull
+ PSComputerName : FPKDSCSCRUBBER1
If I comment out the Members line it goes through with out an error.