xPSDesiredStateConfiguration icon indicating copy to clipboard operation
xPSDesiredStateConfiguration copied to clipboard

xGroup fails with error "Server names cannot contain a space character”

Open andy1547 opened this issue 8 years ago • 1 comments

This issue was recently raised and closed here https://github.com/PowerShell/xPSDesiredStateConfiguration/issues/288

This is still an issue in 6.3.0.0 Trying to add IIS APPPOOL\iHostWSAppPool user to the Administrator group.

Haven't had time to diagnose the full issue but seems to be thrown in the Get-PrincipalContext function.

Was able to get the desired result with this LocalGroupMember cmdlets: Script AddPoolUserToAdministratorGroup { GetScript = { @{ Result = '' } } SetScript = { Add-LocalGroupMember -Group Administrators -Member 'IIS APPPOOL\p') } TestScript = { [bool] ((Get-LocalGroupMember -Group Administrators).Name -eq ('IIS APPPOOL\p'))} }

andy1547 avatar May 09 '17 14:05 andy1547

To add to the problem - We have quite a lot of groups with spaces in them - e.g. "IT ServiceX Admins" - these cannot be added using xGroup as they contain spaces. Issue 288 seems to just whitelist certain groups/users but the problemsolving should be a general fix :-)

Update: This was not a problem with spaces in the Identity part as I first thought. The problem is that UPN style members does not seem to be supported by the 'FindByIdentity' function.

bk147 avatar Dec 01 '17 13:12 bk147