Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

Register-PSSessionConfiguration continues even when error is reported #51

Open
johlju opened this issue Aug 13, 2018 · 0 comments
Open

Comments

@johlju
Copy link

johlju commented Aug 13, 2018

For example when running this on a node not part of the CONTOSO domain.

Invoke-DscResource -ModuleName JustEnoughAdministration -Name JeaEndpoint -Method Set -Verbose -Property @{
            EndpointName        = 'Microsoft.PowerShell'
            RoleDefinitions     = "@{ 'CONTOSO\DnsAdmins' = @{ RoleCapabilities = 'DnsAdmin' } }"
            TranscriptDirectory = 'C:\ProgramData\JeaEndpoint\Transcripts'
            ScriptsToProcess    = @('C:\ProgramData\JeaEndpoint\startup.ps1')
            VisibleCmdlets      = "'DnsServer\*',
                @{
                    'Name'       = 'Restart-Service'
                    'Parameters' = @{
                        'Name'        = 'Name'
                        'ValidateSet' = 'Dns'
                    }
                }"
}

It's reporting this error, but continue to process without failing.

'Could not grant remote access to 'CONTOSO\DnsAdmins': 'Some or all identity references could not be translated.'

I suggest adding -ErrorAction to the calls to Register-PSSessionConfiguration, and maybe also Unregister-PSSessionConfiguration.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant