Wednesday, 11 April 2018

Writing better DSC Configurations with Configuration Data

Configuration Data in Windows PowerShell Desired State Configuration (DSC) allows you to separate the what from the where. Configuration Data enables you to write better DSC configuration. Configuration Data is defined as a Hash table and is passed in when the configuration is compiled. If you're using Automation DSC on Azure, that looks like this:

As you can see on the last line, the configuration data is imported as part of the Automation DSC compilation job.

The basic layout of a Configuration Data file is:

Each Node entry must have a NodeName property as this property is used to generate a MOF file for each node in the AllNodes array.

When you import a Configuration Data file, new variables are available to you when defining your configuration. These variables allow you to define more sophisticated and succinct configurations. The variables are:

  • $AllNodes - Refers to the AllNodes array, use this variable with .Where() and .Foreach()
  • $Node - Refers to the current node within the AllNodes array once the array has been filtered
  • $ConfigurationData - This refers to the entire configuration data file hash table

You can use AllNodes.Where() to select specific nodes, for example, let's say we have a node that has a property of Role, and that role is defined as either DomainController or FileServer. Let's use the below configuration data as an example:

When you compile the above configuration, with the configuration data, you will get two MOF files, one for DC1 and one for FS1. The DC1 configuration file will only have settings for the DNS and NTDS services, the FS1 MOF file will only have settings for a File on D:\.

You can go one step further than this, by using the $ConfigurationData variable to access data outside of the $AllNodes block. Let's look at the below example:

In the above example, the configuration will loop through each of the services defined on a role and add them to the configuration.

Now let's assume that you have heaps of software, features, services and other settings you need to deploy to each of your nodes. You're going to start saving lines in your configuration, and eliminating code that would otherwise be repeated.

Sunday, 11 June 2017

Add-HybridRunbookWorker : Machine is already registered to differnt account


If you receive the error: Add-HybridRunbookWorker : Machine is already registered to differnt account

Simply delete the key under: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HybridRunbookWorker and try the command again.

Saturday, 10 December 2016

Procedure: Using a Responder to block access to a URL from a specific subnet

Create the responder action

In the Expression below, I am creating a HTML response that will respond with the blocked URL, the CLIENT IP and the CLIENT subnet, which is based on a 24-bit mask.

Create a Responder policy

In the expression below, I am checking if the red URL is being accessed and if the subnet (again 24-bit mask) is in the subnet that is not permitted.

Bind the Policy to the vServer

This is a simple process, click the + symbol on Policies, select Responder and bind the responder policy that you’ve created.


From a blocked client

Check the reverse to ensure permitted clients are not blocked. The naming conventions for the NetScaler entities used in this blog post are not recommended in a production environment.

best-it-exam-    | for-our-work-    | hottst-on-sale-    | it-sale-    | tast-dumps-us-    | test-king-number-    | pass-do-it-    | just-do-it-    | pass-with-us-    | passresults-everything-    | passtutor-our-dumps-    | realtests-us-exam-    | latest-update-source-for-    | cbtnuggets-sale-exam    | experts-revised-exam    | certguide-sale-exam    | test4actual-sale-exam    | get-well-prepared-    | certkiller-sale-exam    | buy-discount-dumps    | how-to-get-prepared-for-the    | in-an-easy-way    | brain-dumps-sale    | with-pass-exam-guarantee    | accurate-study-material    | at-first-try    | 100%-successful-rate    | get-certification-easily    | material-provider-exam    | real-exam-practice    | with-pass-score-guarantee    | certification-material-provider    | for-certification-professionals    | get-your-certification-successfully    | 100%-Pass-Rate    | in-pdf-file    | practice-exam-for    | it-study-guides    | study-material-sku    | study-guide-pdf    | prep-guide-demo    | certification-material-id    | actual-tests-demo    | brain-demos-test    | best-pdf-download    | our-certification-material    | best-practice-test    | leading-provider-on    | this-course-is-about    | the-most-reliable    | high-pass-rate-of    | money-back-guarantee    | high-pass-rate-demo    | recenty-updated-key    | only-for-students-free-download    | courseware-plus-kit-for    | accurate-answers-of    | the-most-reliable-id    | provide-training-for    | welcome-to-buy    | material-for-success-pass    | provide-free-support    | best-book-for-pass    | accuracy-of-the-answers    | pass-guarantee-id    | pass-exam-key    | pass-sku-id    | just-do-exid    |    |    |