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

Starting DSC using WMF 5 – Setting company expectations

Hello PowerShell community. I’m looking for thoughts and feedback on the following scenario at work as we start to dive into DSC. My management has bought into the promise of DSC. I’m glad for that (truly). But, the major kick-off to this effort was to hire in a consultant for 3-months, during which we: 1) learn version control, 2) build a server baseline in DSC, 3) build a test framework (pester), 4) Do this using an agile 2-week sprint methodology, 5) at the end, deliver base OS build config via the new DSC configs; 3 of us are working on […]

Read more

Where can I find DSC-specific resources?

We offer a free DSC ebook in our “ebooks” section – just look under the Resources tab. Our forums also have a dedicated section for DSC questions and discussion. At http://github.com/powershellorg/dsc, we host a GitHub repository with a variety of free DSC resource modules and other code.

Read more

Changes to DSC Pull Server Configuration IDs

Has anyone tried to use the ConfigurationNames instead of the ConfigurationID (e.g. GUID)? Not sure how to use the ConfigurationNames in the Pull server. Reference: http://blogs.msdn.com/b/powershell/archive/2015/05/29/how-to-register-a-node-with-a-dsc-pull-server.aspx?utm_content=bufferd9bce&utm_medium=social&utm_source=twitter.com&utm_campaign=buffer

Read more

Issue applying DSC config from pull server

Recently started dipping my toes into the DSC pool, and have run into an odd snag. I created a DSC config, just uses the WindowsFeature resource. I generated the MOF files, and was able to apply it to my test 2012 R2 server in Push mode. Then setup a Pull server (Windows 2012 with WMF 4.0) using the xPSDesiredStateConfiguration DSC config for the pull server. I then created a new GUID, renamed the MOF file to that GUID and generated a checksum. Put those on the Pull server, and reconfigured the test server to use the Pull server. When I […]

Read more

DSC Pull Server Not deploying Resources

Hello everyone, I’ve been running DSC Pull Servers for awhile now and I’ve noticed a new problem. When I deploy a PullServer on PowerShell Version 5 it seems to lose the ability to distribute resources. I’ve been using a fairly basic deployment: WindowsFeature DSCService { Ensure = 'Present' Name = 'DSC-Service' Source = 'c:\sources\sxs' } xDSCWebService PullServerWebService { Ensure = 'Present' EndpointName = 'PSDSCPullServer' Port = 8080 PhysicalPath = "$env:SystemDrive\inetpub\wwwroot\PSDSCPullServer" CertificateThumbPrint = 'AllowUnencryptedTraffic' ModulePath = "$env:ProgramFiles\WindowsPowerShell\DSCService\Modules" ConfigurationPath = "$env:ProgramFiles\WindowsPowerShell\DSCService\Configuration" State = 'Started' DependsOn = '[WindowsFeature]DSCService' } xDSCWebService PullServerComplianceService { Ensure = 'Present' EndpointName = 'PSDSCComplianceServer' Port = 9080 PhysicalPath = […]

Read more

DSC Reboot Loop

I have created a DSC to prepare a server to host Active Director Group Policy Management. As we’re moving to using DSC to maintain configurations of servers this seemed an easy one. There are a handful of features that are required for the service as well as a handful that we want on the system. Additionally I need to make sure there is an archive folder, and that the windows\temp directory is available. I have set ensure=present to all features I need and ensure=absent to all features I don’t need. What I see is that my machine want’s to reboot […]

Read more

Major Changes to DSC Pull Server Configuration IDs

Configuration IDs – Globally Unique Identifiers, or GUIDs, that DSC nodes use to identify themselves to a pull server – have always been a limiting factor in DSC design and architecture. In the April 2015 preview of WMF5, however, Microsoft has completely overhauled Configuration IDs. If you’re working with DSC, this is must-have information.

Read more