MVA Module 4 Update-DSCConfiguration

So I have spent about 10 hours in the last 3 days trying to resolve this. I have. Installed the preview ps 5 installed mva* modules Checked the permissions for my share (everyone everything) Changed my share (MOF instead of DSCSMB) I am using server 2012 r2 the evaluation VHD from Microsoft I can log on S1 and browse \\AD\MOF and see the files I can delete and rename the files The GuID # Matches my configuration file name (generated with the MVA scripts) I have done much more but my brain is numb, any suggestions?? PS C:\> Update-DscConfiguration -ComputerName […]

Read more

How to get rid of PSDscAllowPlainTextPassword (PS 4)

We are security tightening up scripts at the moment. Who has built a successful example of using Certificates and Thumbprint instead of using the notoriously bad PSDscAllowPlainTextPassword Attribute using PowerShell 4.0. Configuration ExampleConfig { param( [string] $myUserName ,[string] $myFullName ,[PSCredential] $myPassword ) Node $AllNodes.where{ $_.Role.Contains("myrole") }.NodeName { User MyUser { UserName = $myUserName Ensure = "Present" FullName = $myFullName Password = $myPassword } LocalConfigurationManager { CertificateId = $node.Thumbprint } } } # cut the first half that declared the parameters and values $ConfigData = @{ AllNodes = @( @{ NodeName = "10.0.0.5" myUserName = $userName myFullName = $userName myPassword = […]

Read more

Multiple Composite DSC using Single Resource

I have several composite DSC resources that make my master configurations super simple. However I just ran into a problem where a composite DSC is using the xGroup resource to add a member to local administrators. I then need to also add another user to administrators as part of the master configuration. This errors because the group name “Administrators” is the key for the xGroup resource. Has anyone run into this scenario and how’d you get around it? I currently see these as my options and I’m not sure which is best… 1) Modify xGroup (cGroup) to support what I […]

Read more

register Dsc Agent

while trying to connect a node to my pull server i am getting this error Job {ACAF7E92-3B7A-11E5-80BF-0050569110F7} : MIResult: 1 Error Message: The attempt to register Dsc Agent with AgentId 8CD7AB8D-3A73-11E5-80BE-0050569110F7 with the server https://srv-nps:8080/PSDSCPullServer.svc/Nodes(AgentId=’8CD7AB8D-3A73-11E5-80BE-0050569110F7′) returned unexpected response code InternalServerError. Message ID: RegisterDscAgentUnsuccessful,Microsoft.PowerShell.DesiredStateConfiguration.Commands.RegisterDscAgentCommand Error Category: 8 Error Code: 1 Error Type: MI

Read more

Remote Start-DscConfiguration cannot find DSC resources

I’m writing a “push” script for testing that copies the modules of a MOF to the C:\Program Files\WindowsPowerShell\Modules path of a remote host then executes a Start-DscConfiguration with the ComputerName parameter. It seems when I try to apply the MOF remotely it tells me one of the modules (xNetworking) does not exist yet if I use Invoke-Command against the computer and do Get-Module xNetworking -ListAvailable it shows and Get-DscResource shows all the resources from the copied modules. The MOF file is on my local machine, I’m using this to start it, assuming I don’t need the copy the MOF file […]

Read more

Class Based DSC Resource Credentials

Hi All , When I run DSC on remote machine I receive following error : Invalid embedded (reference) property value was found. The value object is of class type ‘MSFT_Credential’, which is not ‘MSFT_KeyValuePair’ or its derived classes. I’m passing my credentials to set schedule job . When I run DSC on the localhost is working fine . I would appreciate any help . Regards Mariusz

Read more

DSC for Azure Web and Worker Role Deployment

Hi Team, I would like to know that – Is DSC can be used for Azure Web/Worker role deployment? Is it recommended to use DSC in this case. Need help if someone already address this scenario. Thank You, Dilip Dodiya

Read more

Get-ADObject with Credentials in DSC resource SSPI errors

My DSC target is in a forest “TEST” that has a one-way trust with “PROD” forest. $Credential = Get-Credential PROD\USER Get-ADObject -Filter {SamAccountName -eq 'TARGET'} -Server TEST -Credential $Credential If I run this from within PowerShell on the system as a user in the TEST forest it works. I even tried PSEXEC to launch as a SYSTEM process and it works. When DSC tries to do this it errors with: A call to SSPI failed, see inner exception. —> No credentials are available in the security package Any thoughts on what the problem could be or the difference of a […]

Read more

DSC Provisioning Choosing a Database

I have finally started to win over more and more people in my company to the advantages of PowerShell. So much so, I have been asked to reconstruct our entire provisioning process. Very excited for the opportunity. I have started trying to constructed what all the pieced need to be, and I am going to start with and Authoring server and two Pull servers behind a load balancer. We have many different environments with different domains across two main datacenter. In our current system we construct these Affinities that ultimately provide the data to build the server to meet all […]

Read more

DSC Proxy Machine (Load Balancer)

I want to try and use DSC to manage a load balancer that exposes a REST API. Some chef/puppet-like tools have the concept of a proxy node that acts as the real device for purposes of configuring another device. How would I handle this in DSC (assuming I write the resources for interacting with the API)?

Read more

Custom DSC Resources – Classes – Error handling

Hello, I would like to discuss with you error handling in custom DSC resources (mainly for classes). I have seen several times similar code: [void] Set() { try { # Do something } catch { Write-Verbose -Message $_.Exception.Message } } For example here: https://github.com/TravisEz13/xTimeZoneClassSingleInstance/blob/master/xTimeZone.psm1 Btw. the code in example will not work because there is (for any reason) $PSCmdlet.ShouldProcess. I think it is totally wrong to close all code in Set() to try-catch block and then output exception message in verbose stream. Of course there are reasons why to add part of your code that can fail to try-catch and […]

Read more

DSC Exception when installing package

I’m trying to install BizTalk 2013 Std from a local MSI, but get the following exception in the DSC event log. Any idea what’s going wrong ? Message Object reference not set to an instance of an object. HResult -2147467261 StackTrack at Microsoft.PowerShell.DesiredStateConfiguration.Internal.DownloadManagerBase.GetDownloadManagerNameFromCimInstanceV2(CimInstance cimInstancev2) at Microsoft.PowerShell.DesiredStateConfiguration.Internal.DownloadManagerBase.GetPluginModuleName(IntPtr metaConfigHandle, PlugInType plugInType, String& pluginName, ErrorRecord& errorRecord, String partialConfigName) at Microsoft.PowerShell.DesiredStateConfiguration.Internal.DownloadManagerBase.ImportDownloadManager(IntPtr metaConfigHandle, Boolean debugMode, PlugInType plugin, ErrorRecord& errorRecord, String partialConfigName) at Microsoft.PowerShell.DesiredStateConfiguration.Internal.DownloadManagerBase.InstallDscDocumentDependencies(IntPtr metaConfigHandle, IntPtr& errorInstanceHandle, String mofFileName, UInt32& getActionStatusCode) at Microsoft.PowerShell.DesiredStateConfiguration.Internal.DscPluginManagedEntryWrapper.Push_DependencyCheck_ManagedPlugin(IntPtr provContext, IntPtr metaConfig, String mofFileName, IntPtr getActionStatusCode, IntPtr extendedError, String jobIdNative)

Read more

DSC custom resource using Classes – Each class in separate file

Hello, all examples of custom modules with DSC resources with PowerShell Classes have all classes (all resources) in a single psm1 file. Please is it possible to put each class in separate file? I know that dot notation is old concept but it is very handy for custom modules (advanced functions with manifest) because I can put each function in separate ps1 file and use dot notation in psm1 file to include all files (all functions). I tried this approach with classes in order to put each DSC resource in separate file but this is not working. Thank you.

Read more

How to change default values in registry with DSC registry resource

Hi all, I’m trying to change the default value for a key. When I try do this with the Registry Resource it simply creates a “second” (Default) value in key. Is it a bug or am I doing it wrong? Registry WinDirStatDirectoryConfig { DependsOn = "[Archive]InstallWinDirStat" Ensure = 'Present' Force = $True Key = 'HKEY_CLASSES_ROOT\Directory\shell\Show WinDirStat\command' ValueName = "(Default)" ValueType = 'String' ValueData = '"C:\Program Files (x86)\WinDirStat\windirstat.exe" "%1"' }

Read more

FirstFile Failed In Start-DSCConfiguration

HI All, I am getting one weird issue while running the Start-DSCConfiguration command for a configuration. FindFirstFile Failed. + CategoryInfo : NotSpecified: (root/Microsoft/…gurationManager:String) [], CimException + FullyQualifiedErrorId : MI RESULT 1 + PSComputerName : localhost Checked the event log , found nothing helpful. Please help me with advice\suggestions. Thanks, Aravinda

Read more