Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Powershell DSC user configuration does not work correctly for any reason.

$
0
0
I'm trying to create windows user automatically by using powershell dsc.

However I got an error which shows as blow:

The PowerShell DSC resource MSFT_UserResource threw one or more non-terminating errors while running the Set-TargetResource functionality.
These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational. Refer to this channel for more details.
    + CategoryInfo          : InvalidOperation: (:) [], CimException
    + FullyQualifiedErrorId : NonTerminatingErrorFromProvider
    + PSComputerName        : localhost
 
The SendConfigurationApply function did not succeed.
    + CategoryInfo          : NotSpecified: (root/Microsoft/...gurationManager:String) [], CimException
    + FullyQualifiedErrorId : MI RESULT 1
    + PSComputerName        : localhost

My environment is :

 VM: Win2012 R2 on AWS EC2.

My DSC configuration is very simple as below:

Configuration AddUser {
    param (
        [Parameter(Mandatory=$true)]
        [PSCredential]$Password
    )

    Import-DscResource -ModuleName PSDesiredStateConfiguration

    Node "localhost" {
        User UserExample {
            UserName = "SomeName"
            Password = $Password
        }
    }
}

$cd = @{
    AllNodes = @(
        @{
            NodeName = 'localhost'
            PSDscAllowPlainTextPassword = $true
        }
    )
}

$cred = Get-Credential -UserName SomeName -Message "Password please"
AddUser -Password $cred -ConfigurationData $cd -OutputPath 'C:\DSC\AddUser'

I got a MOF file in outputPath correctly.
And after that, I get the error whenI execute Start-DSCConfiguration commandlet as below.

Start-DscConfiguration -ComputerName localhost -Wait -Force -Verbose -path C:\dsc\AddUser

I can't understand what's wrong with it.
Please give me any information to fix it. I couldn't find any information on the internet about this prolem..

(I found an article which describe as a similar phenomenon. But I can't understand what to do for my issue.)
If you know there is any precondition to do DSC, please let me know!
!



Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>