Closed PlekyNeed closed 4 years ago
I've got similar issue when trying to include user to "Users" group
Group ManageUsersGroup {
GroupName='Users'
DependsOn= '[User]OperatotUser'
Ensure= 'Present'
MembersToInclude= 'operator'
}
Exception calling ".ctor" with "2" argument(s): "Server names cannot contain a space character."
+ CategoryInfo : InvalidOperation: (:) [], CimException
+ FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand
+ PSComputerName : DESKTOP-V20KT15
Using
Major Minor Build Revision
----- ----- ----- --------
5 1 17763 1007
Have we got any solution for this?
I've got similar issue when trying to include user to "Users" group
Group ManageUsersGroup { GroupName='Users' DependsOn= '[User]OperatotUser' Ensure= 'Present' MembersToInclude= 'operator' }
Exception calling ".ctor" with "2" argument(s): "Server names cannot contain a space character." + CategoryInfo : InvalidOperation: (:) [], CimException + FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand + PSComputerName : DESKTOP-V20KT15
Using
Major Minor Build Revision ----- ----- ----- -------- 5 1 17763 1007
Have we got any solution for this?
Ok, the devil is in the detail
if you import right module everything works fine
Import-DscResource -ModuleName 'PSDscResources'
# Import-DscResource -ModuleName 'PSDesiredStateConfiguration'
Hi @PlekyNeed and @DimaGepard - you are right: PSDesiredStateConfiguration
is the built in resources, so you want to use PSDscResources
. Alternately you can also use xPSDesiredStateConfiguration
(https://github.com/dsccommunity/xPSDesiredStateConfiguration)- this is the community maintained one. However, that one is not guaranteed to be 100% feature compatible with PSDscResources
. Note: xPSDesiredStateConfiguration
is not supported by Microsoft - it is community supported.
Hello,
I'm trying to remove a user from builtin "Users" local group.
$NO_ACCESS_USERS = @('myUser') GroupSet GroupUsersCleaningNO_ACCESS { GroupName = @("Users") Ensure = "Present" MembersToExclude = $NO_ACCESS_USERS
Credential = Get-Credential
I've got a : Exception calling ".ctor" with "2" argument(s): "Server names cannot contain a space character."
it looks similar to issue : https://github.com/PowerShell/PSDscResources/issues/26
"Users" contains Authenticated Users and Interactive
Thanks for your help