<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Microsoft Datacenter blog by Ralph Kyttle</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/ralphkyttle/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/ralphkyttle/feed.xml</link>
    <description>Here I share my thoughts and experiences with Microsoft Datacenter technologies</description>
    <lastBuildDate>Fri, 05 Jan 2018 22:06:07 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Verifying Spectre / Meltdown protections remotely</title>
      <link>https://docs.microsoft.com/archive/blogs/ralphkyttle/verifying-spectre-meltdown-protections-remotely</link>
      <pubDate>Fri, 05 Jan 2018 17:06:07 GMT</pubDate>
      <dc:creator><![CDATA[Ralph Kyttle]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/ralphkyttle/?p=235</guid>
      <description><![CDATA[In this post we will take a look at the SpeculationControl PowerShell module that was recently...]]></description>
      <content:encoded><![CDATA[In this post we will take a look at the <a href="https://www.powershellgallery.com/packages/SpeculationControl">SpeculationControl PowerShell module</a> that was recently released by the Microsoft Security Response Center to help with verifying Spectre / Meltdown protections.

SpeculationControl can be found on the PowerShell Gallery at the following link: <a href="https://www.powershellgallery.com/packages/SpeculationControl">https://www.powershellgallery.com/packages/SpeculationControl</a>

Installing this module onto a system adds a new function called Get-SpeculationControlSettings and this function can be run on a system to provide details on whether Spectre / Meltdown protections have been enabled.

<strong> What if you wanted to run this remotely against multiple systems?</strong>

To run the Get-SpeculationControlSettings function against multiple systems, see the example code below:
(Credit goes to <a href="https://github.com/krjhitch">Keith Hitchcock</a> for his help on this)

<script src="https://gist.github.com/rkyttle/c71edd95c99c8aa905cf1720a86a7730.js"></script>
This example only requires that you have the SpeculationControl PowerShell module installed on the system that you execute this code from. Because of the way the Get-SpeculationControlSettings function is structured, we can simply load the function remotely as part of the call to Invoke-Command.

In order to run this sample code in an environment, the only update required is the list of machines that follow -ComputerName. If you prefer to pass in a list of systems in a text file, the sample code can easily be modified to take in an input text file by utilizing the Get-Content cmdlet.
<script src="https://gist.github.com/rkyttle/c81ea65f92aaf4c34ace734fc9f6a0f0.js"></script>

<strong>Sample output</strong>
<a href="https://msdnshared.blob.core.windows.net/media/2018/01/SpeculationControlSettings1.jpg"></a><a href="https://msdnshared.blob.core.windows.net/media/2018/01/SpeculationControlSettings1-e1515188304832.jpg"><img width="1024" height="685" class="alignnone size-large wp-image-245" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/01/SpeculationControlSettings1-1024x685.jpg" /></a>

While this is nice, we can take things a step further by outputting the results to CSV which will make things easier to consume, especially as we start adding more systems to the list.

<strong>Example code below:</strong>
<script src="https://gist.github.com/rkyttle/18f64fb9d96ced0b5652804068a714e3.js"></script>
<strong>Sample output
<a href="https://msdnshared.blob.core.windows.net/media/2018/01/SpeculationControlSettings3-e1515188682166.jpg"><img width="1024" height="195" class="alignnone size-large wp-image-256" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/01/SpeculationControlSettings3-1024x195.jpg" /></a>
</strong>

This is now easier to digest, and we can sort and apply filters as needed.

At this point, we have taken the SpeculationControl PowerShell module and run it through a few examples that take it beyond local execution and help us review remote systems in an environment.

Next, we will take a look at using the SpeculationControl PowerShell module along with another PowerShell module called <a href="https://www.powershellgallery.com/packages/DSCEA">DSCEA</a>. DSCEA provides configuration testing and reporting capabilities for Windows based systems, and we will take a look at how we can use it to gain some intelligence from the data that we are able to gather remotely.

For example, let’s say your management team is looking for numbers, specifically how many machines exist in your environment that have not yet been patched for the CVE-2017-5754 rogue data cache load (Meltdown) vulnerability.

While we could ask someone to look through the CSV file and compare systems across multiple columns, I’d rather have a computer provide me with this information.

There are a few points to make though before we go down the DSCEA path. DSCEA requires a minimum PowerShell version of 5.0, with 5.1 being recommended. Also, DSCEA would require that the SpeculationControl PowerShell module be installed on all endpoints that are being scanned. While there are some easy ways to handle this which include pushing out a DSC configuration that utilizes the DSC File resource, or just a file copy script, for this example I am including the entire Get-SpeculationControlSettings function as a part of my custom DSC configuration. This just makes this a whole lot easier to demonstrate, but it does require code updates if there are updates to the SpeculationControl PowerShell module in the future.

This section will assume you have downloaded DSCEA and have some knowledge of its usage. If you don’t, <a href="https://microsoft.github.io/DSCEA/">click here to learn more.</a>

I have copied the DSC configuration at the end of this post that will be used to verify if systems have been patched for Meltdown. You will use this configuration to build a MOF file that you will use with DSCEA to scan systems to see if they have the proper updates and configurations enabled.

The configuration comes with the following logic defined to determine if a system has been properly configured in regards to Meltdown:
<script src="https://gist.github.com/rkyttle/3576756e1d6fe3f5234b75abfa045289.js"></script>

<strong>DSCEA HTML Report Example</strong>
In this case, all 3 systems are non-compliant, meaning they need to be reviewed to get the proper updates and settings applied.

<a href="https://msdnshared.blob.core.windows.net/media/2018/01/SpeculationControlSettings4-e1515189011204.jpg"><img width="1024" height="637" class="alignnone size-large wp-image-265" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/01/SpeculationControlSettings4-1024x637.jpg" /></a>

<strong>DSC Configuration</strong>
<script src="https://gist.github.com/rkyttle/68dbae75b4851564c4b2531f5c78abfd.js"></script>]]></content:encoded>
    </item>
    <item>
      <title>SMB1 - Audit Active Usage using Message Analyzer</title>
      <link>https://docs.microsoft.com/archive/blogs/ralphkyttle/smb1-audit-active-usage-using-message-analyzer</link>
      <pubDate>Sat, 13 May 2017 21:25:21 GMT</pubDate>
      <dc:creator><![CDATA[Ralph Kyttle]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/ralphkyttle/?p=195</guid>
      <description><![CDATA[Well, it’s another weekend and here we are again talking about SMB1. The WannaCrypt Ransomware...]]></description>
      <content:encoded><![CDATA[Well, it’s another weekend and here we are again talking about SMB1. The <a href="https://blogs.technet.microsoft.com/msrc/2017/05/12/customer-guidance-for-wannacrypt-attacks/">WannaCrypt Ransomware</a> attacks that impacted customers all over the world have put a spotlight on SMB1, and how important it is to <a href="https://blogs.technet.microsoft.com/filecab/2016/09/16/stop-using-smb1/">Stop using SMB1</a>. Let’s say you have gone ahead and successfully deployed the security update associated with <a href="https://technet.microsoft.com/en-us/library/security/ms17-010.aspx">Microsoft Security Bulletin MS17-010</a> to all of your systems, but SMB1 is still allowed in your environment. If this is the case, you are still operating at a high risk level and you need to find your path towards completely ending SMB1 usage.

If you haven’t taken the time to <a href="https://support.microsoft.com/en-us/help/2696547/how-to-enable-and-disable-smbv1,-smbv2,-and-smbv3-in-windows-vista,-windows-server-2008,-windows-7,-windows-server-2008-r2,-windows-8,-and-windows-server-2012">disable SMB1</a> in your environment yet, you need to start working on it right now. If SMB1 is still lingering around because you’ve been fearful that turning it off would break something, you need to take the time to review system level communication in your environment to determine if there are any devices that communicate with your Windows servers that only work with SMB1 and would be negatively affected if SMB1 were removed or disabled. In an environment with only Windows servers (2008 and above), disabling SMB1 should have zero negative impact. Servers will use either SMB2 or SMB3 to communicate via SMB with one another, auto-negotiating to the latest available protocol version.

So, you know what you need to do, but you're not sure if you might break some existing functionality because you don't know if there are devices that connect in to your systems that can only use SMB1. There are a few options that can help in this scenario:
<ol>
 	<li>If you are running Windows 10 and Windows Server 2016, you can use the <a href="https://technet.microsoft.com/en-us/itpro/powershell/windows/smbshare/set-smbserverconfiguration#-auditsmb1access">Set-SmbServerConfiguration</a> cmdlet and the AuditSmb1Access parameter to configure SMB1 auditing by running the command: Set-SmbServerConfiguration –AuditSmb1Access $true (You can then review the Microsoft-Windows-SMBServer/Audit log for any events indicating SMB1 activity)</li>
 	<li>Talk to your network or security team to see if there is anything that they can enable on your organization’s routers and switches that can log traffic throughout your environment to see if SMB1 is being used anywhere.</li>
 	<li>Perform network captures on systems that you suspect may be communicating with devices that only support SMB1. System design documents can be useful here to point out the expected communication flow for a deployed application. It is also worth noting that end user client systems can sometimes act as SMB servers, so they should be evaluated too and their traffic analyzed if needed. Clients can talk to seemingly innocuous devices that run SMB1, like printers, NAS, manufacturing gear, etc. that themselves aren’t running Windows but Samba/Linux, and they would need to be investigated in some promiscuous fashion.</li>
</ol>
If you’re like me, you’ll most likely be going with the option 3 network capture, which I will explain in detail below. Overall, your goal should be to disable SMB1 on all Windows systems in your environment, but I recommend that you review server communication in your environment to determine if there are any devices that communicate with your Windows servers that only work with SMB1 and would be negatively affected if SMB1 were removed or disabled. If any devices are discovered that need to communicate with Windows servers over SMB which only support SMB1, further investigation and coordination will be needed before SMB1 is removed or disabled from the Windows servers these devices communicate with to avoid any interruption to service.

To assist with this effort, network traffic can be captured and analyzed using <a href="https://www.microsoft.com/en-us/download/details.aspx?id=44226">Microsoft Message Analyzer</a>. Message Analyzer can be used to create network trace sessions which can log all inbound and outbound communication on a system. These logs can then be filtered and reviewed to see if there is any active SMB1 traffic happening on the Windows servers in your environment. To filter the logs to only display SMB1 related data, use SMB as a filter within Message Analyzer. If the SMB1 protocol is being used, you will likely see many events in your view, similar to the example shown below.

<a href="https://msdnshared.blob.core.windows.net/media/2017/05/SMB1.png"><img width="1024" height="502" class="alignnone size-large wp-image-205" alt="smb1" src="https://msdnshared.blob.core.windows.net/media/2017/05/SMB1-1024x502.png" /></a>

In the example above, the first message shows the initial negotiation attempt from the client to the server. The summary field shows information from the negotiation, including the available protocols that the client can utilize in its attempt to communicate with the server.

<strong>ComNegotiate, Status: STATUS_SUCCESS, Selected Dialect: NT LM 0.12, Requested Dialects: [PC NETWORK PROGRAM 1.0, LANMAN1.0, Windows for Workgroups 3.1a, LM1.2X002, LANMAN2.1, NT LM 0.12]</strong>

Looking at this, we see a list of legacy protocols which by themselves indicate that the client in this example only supports SMB1, and if SMB1 was disabled or removed from the server we can expect that the client would start having problems communicating to the server using SMB.

In contrast, the example below showcases the same filtering options, but takes a look at a client that supports SMB1, SMB2 and SMB3.

<a href="https://msdnshared.blob.core.windows.net/media/2017/05/SMB3_1.png"><img width="1024" height="471" class="alignnone size-large wp-image-215" alt="smb3_1" src="https://msdnshared.blob.core.windows.net/media/2017/05/SMB3_1-1024x471.png" /></a>

In this case, we are again looking at the initial negotiation from the client to the server, but we can see additional protocols listed in the summary field that the client can utilize in its attempt to communicate with the server.

<strong>ComNegotiateRequest, Tid: 0xFFFF, Mid: 0x0000, Dialects: [PC NETWORK PROGRAM 1.0, LANMAN1.0, Windows for Workgroups 3.1a, LM1.2X002, LANMAN2.1, NT LM 0.12, SMB 2.002, SMB 2.???]</strong>

We can see that this client not only supports SMB1 but SMB2 as well at a minimum, and in this example we are looking at Windows Server 2012 R2 system that supports SMB3 as well. If SMB1 was disabled or removed from the server we can expect that the client would have no issues communicating to the server using SMB as it will negotiate up to SMB 2/3, which we can see in the screenshot below that uses the SMB2 filter in Message Analyzer.

<a href="https://msdnshared.blob.core.windows.net/media/2017/05/SMB3_2.png"><img width="1024" height="498" class="alignnone size-large wp-image-225" alt="smb3_2" src="https://msdnshared.blob.core.windows.net/media/2017/05/SMB3_2-1024x498.png" /></a>

After reviewing server communication and performing network captures where required, please disable or remove SMB1 from as many systems in your environment as possible. SMB1 existence can be scanned for by using <a href="https://blogs.technet.microsoft.com/ralphkyttle/2017/04/07/discover-smb1-in-your-environment-with-dscea/">DSCEA</a> so you can track your progress as you complete this important task.]]></content:encoded>
    </item>
    <item>
      <title>Discover SMB1 in your environment with DSCEA</title>
      <link>https://docs.microsoft.com/archive/blogs/ralphkyttle/discover-smb1-in-your-environment-with-dscea</link>
      <pubDate>Fri, 07 Apr 2017 00:59:12 GMT</pubDate>
      <dc:creator><![CDATA[Ralph Kyttle]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/ralphkyttle/?p=155</guid>
      <description><![CDATA[So, SMB1. Hopefully by now you have already heard and heeded the advice Ned Pyle provided in the...]]></description>
      <content:encoded><![CDATA[So, SMB1. Hopefully by now you have already heard and heeded the advice Ned Pyle provided in the link below, and you are no longer using SMB1 in your environment. <a href="https://blogs.technet.microsoft.com/filecab/2016/09/16/stop-using-smb1">https://blogs.technet.microsoft.com/filecab/2016/09/16/stop-using-smb1</a>

Let’s say though that for some reason, you have not followed Ned’s advice yet and you still have some Windows systems in your environment that are using the SMB1 protocol. The same nearly 30 year old SMB1 protocol that Ned explains isn’t safe, isn’t modern or efficient, isn’t usually necessary, and isn’t hard to remove. And let’s say you would like to remove this unsafe, legacy, inefficient and usually unnecessary protocol from the systems in your environment. Ned explains some great methods to <strong>remove</strong> the SMB1 feature starting in Windows 8.1 and Windows Server 2012 R2, and the steps to <strong>disable</strong> SMB1 on legacy operating systems including Windows Vista, Windows Server 2008, Windows 7, Windows Server 2008 R2, Windows 8, and Windows Server 2012.

Wouldn’t it be nice if there was a way for you to run a scan against your environment and determine if any systems had SMB1 installed or enabled?

I’m happy you asked 🙂

About two weeks ago we introduced <a href="https://blogs.technet.microsoft.com/ralphkyttle/2017/03/21/introducing-dscea/">DSCEA</a>, a new PowerShell module that allows you to author a desired configuration state in PowerShell DSC and then scan your environment to determine if systems are compliant with the configuration you defined.

DSCEA requires that your systems are running at least PowerShell version 5.0, and has some additional requirements listed <a href="https://microsoft.github.io/DSCEA/">here</a>.

Let’s take a look at one example of how we can use DSCEA to scan a Windows Server 2012 R2 environment to see if any of the systems have SMB1 installed. We’ll start by authoring a DSC configuration file that defines the desired state of our systems, which is that the Windows Feature for SMB1 should not be installed.

<script src="https://gist.github.com/rkyttle/6aa9e27e6c7fdfa1ac28dc6976831f92.js"></script>

Next, we will perform a DSCEA scan of a group of systems to see if they are configured to our desired state, or if they have the SMB1 Windows Feature installed <strong>(The default setting in Windows Server 2012 R2)</strong>.
<pre><code>PS C:\&gt; C:\Users\username\Documents\DSCEA&gt; Start-DSCEAscan -MofFile .\localhost.mof -ComputerName dsctest-1, dsctest-2, dsctest-3</code></pre>
More information on performing a scan with DSCEA can be found at the DSCEA documentation site: <a href="https://microsoft.github.io/DSCEA">https://microsoft.github.io/DSCEA</a>

Now that we have scanned they systems in the environment to see how they match up, we need to generate some reports. DSCEA has multiple options when it comes to reporting. You can generate HTML reports, export result data as CSV, and also take an exported CSV file and bring it into Microsoft PowerBI for deeper insights and enhanced visuals in your report.

Let’s start by taking the XML raw data output we received from our scan and generate some HTML reports to get a quick, tactical view of how the systems are looking.
<pre><code>PS C:\&gt; C:\Users\username\Documents\DSCEA&gt; Get-DSCEAreport -Overall -InFile 'C:\Users\username\Documents\DSCEA\results.20170406-2309-05.xml' -OutPath 'C:\Users\username\Documents\DSCEA'</code></pre>
<pre><code>PS C:\&gt; C:\Users\username\Documents\DSCEA&gt; Get-DSCEAreport -Detailed -InFile 'C:\Users\username\Documents\DSCEA\results.20170406-2309-05.xml' -OutPath 'C:\Users\username\Documents\DSCEA'
</code></pre>
Running the commands above generated some HTML reports, shown below.

The first report is an overall report, which displays if systems match the desired configuration.  In this case, all 3 systems failed our scan, indicating that they all have SMB1 installed.

<a href="https://msdnshared.blob.core.windows.net/media/2017/04/OverallHTML.png"><img width="1024" height="690" class="alignnone wp-image-165 size-large" alt="overallhtml" src="https://msdnshared.blob.core.windows.net/media/2017/04/OverallHTML-1024x690.png" /></a>

The second report is a detailed report, showing the items in the DSC configuration that were found as non-compliant.  In this case, we only scanned for the SMB1 feature, so all 3 systems indicate that as the reason they failed to meet the compliancy requirements.

<a href="https://msdnshared.blob.core.windows.net/media/2017/04/DetailedHTML.png"><img width="1024" height="690" class="alignnone size-large wp-image-167" alt="detailedhtml" src="https://msdnshared.blob.core.windows.net/media/2017/04/DetailedHTML-1024x690.png" /></a>

Armed now with this knowledge, we know which systems require attention and need to have SMB1 removed.

For legacy operating systems, the same guidance applies except you'll need a different DSC configuration file that targets settings in the registry as defined here: <a href="https://support.microsoft.com/en-us/help/2696547/how-to-enable-and-disable-smbv1,-smbv2,-and-smbv3-in-windows-vista,-windows-server-2008,-windows-7,-windows-server-2008-r2,-windows-8,-and-windows-server-2012">https://support.microsoft.com/en-us/help/2696547/how-to-enable-and-disable-smbv1,-smbv2,-and-smbv3-in-windows-vista,-windows-server-2008,-windows-7,-windows-server-2008-r2,-windows-8,-and-windows-server-2012</a>

Example using registry key setting:

<script src="https://gist.github.com/rkyttle/7be5477af85fe1e45fe5ee414ebd4fcd.js"></script>

So, what are you waiting for?  Download DSCEA, scan the systems in your environment and <strong>STOP USING SMB1!</strong>]]></content:encoded>
    </item>
    <item>
      <title>DSCEA 1.2.0.0 has been released - Introducing exciting new updates to Start-DSCEAscan</title>
      <link>https://docs.microsoft.com/archive/blogs/ralphkyttle/dscea-1-2-0-0-has-been-released-introducing-exciting-new-updates-to-start-dsceascan</link>
      <pubDate>Wed, 05 Apr 2017 17:06:04 GMT</pubDate>
      <dc:creator><![CDATA[Ralph Kyttle]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/ralphkyttle/?p=145</guid>
      <description><![CDATA[DSCEA 1.2.0.0 has been released

Details on this release are listed below:

 	Introduced...]]></description>
      <content:encoded><![CDATA[<a href="https://microsoft.github.io/DSCEA/mydoc_functions_reference.html">DSCEA</a> 1.2.0.0 has been released

Details on this release are listed below:
<ul>
 	<li>Introduced exciting new updates to Start-DSCEAscan
<ul>
 	<li>Automatic copying of any custom resources needed for a scan from the management system to the remote endpoints being scanned
<ul>
 	<li>Thank you to <a href="https://github.com/anwather">Anthony Watherston</a> for adding this capability to DSCEA!</li>
</ul>
</li>
 	<li>Added a new Path parameter, which allows Start-DSCEAscan to take in a folder path containing machine specific MOF files to allow for a scan of those systems against unique per system settings</li>
</ul>
</li>
 	<li>Added additional config examples
<ul>
 	<li>Config that uses non built-in DSC resources</li>
 	<li>Config that showcases using the DSC script resource
<ul>
 	<li>Thank you to <a href="https://www.linkedin.com/in/patrick-mercier-80876941/">Patrick Mercier</a> for your contributions and feedback on this!</li>
</ul>
</li>
</ul>
</li>
 	<li>Bug fixes
<ul>
 	<li>Fixed issue where errors were thrown when running Import-Module DSCEA
<ul>
 	<li>Thank you to <a href="https://github.com/majst32">Melissa Januszko</a> for pointing this out!</li>
</ul>
</li>
 	<li>Fixed quote character issue when running Get-Help Start-DSCEAscan</li>
</ul>
</li>
 	<li>Documentation updates
<ul>
 	<li>Clarified instructions on Report Generation with Power BI page
<ul>
 	<li>Thank you to <a href="https://github.com/zjalexander">Zachary Alexander</a> for updating this page!</li>
</ul>
</li>
 	<li>Clarified instructions on PowerShell Gallery - Offline Install page</li>
 	<li>Added page - Convert DSCEA scan result to CSV</li>
 	<li>Added page - DSCEA Functions Reference</li>
</ul>
</li>
</ul>
Links

<a href="https://www.powershellgallery.com/packages/DSCEA">https://www.powershellgallery.com/packages/DSCEA</a>
<a href="https://github.com/Microsoft/DSCEA">https://github.com/Microsoft/DSCEA</a>
<a href="https://microsoft.github.io/DSCEA">https://microsoft.github.io/DSCEA</a>

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>Introducing DSCEA</title>
      <link>https://docs.microsoft.com/archive/blogs/ralphkyttle/introducing-dscea</link>
      <pubDate>Tue, 21 Mar 2017 16:49:26 GMT</pubDate>
      <dc:creator><![CDATA[Ralph Kyttle]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/ralphkyttle/?p=126</guid>
      <description><![CDATA[Updated with a link to the latest release announcement, DSCEA...]]></description>
      <content:encoded><![CDATA[<strong>Updated with a link to the latest release announcement, DSCEA 1.2.0.0</strong>
<a href="https://blogs.technet.microsoft.com/ralphkyttle/2017/04/05/dscea-1-2-0-0-has-been-released-introducing-exciting-new-updates-to-start-dsceascan/"><strong>https://blogs.technet.microsoft.com/ralphkyttle/2017/04/05/dscea-1-2-0-0-has-been-released-introducing-exciting-new-updates-to-start-dsceascan/</strong></a>

Hello, World! :)

I am incredibly excited to announce the open source release of DSC Environment Analyzer (DSCEA), a PowerShell module that uses the declarative nature of <a href="https://msdn.microsoft.com/en-us/PowerShell/dsc/overview">Desired State Configuration</a> to scan systems in an environment against a defined reference MOF file and generate compliance reports as to whether systems match the desired configuration.

DSCEA includes a customizable reporting engine that can provide reports on overall compliance and details on any DSC resource found to be non-compliant.  DSCEA utilizes the DSC processing engine and DSC resources to audit and report on the existing configuration of machines in an environment.

By using PowerShell Desired State Configuration at its core, DSCEA obtains some unique advantages. Most notably, by defining the desired configuration state using DSC, an admin can benefit from using the same work to both scan for compliance and then correct items that were found to be non-compliant. Building an audit file in DSC can help ease remediations, and in some cases it can be as simple as applying the same MOF file that was used to scan an environment onto systems to correct drift and bring things into the desired state.

DSCEA is hosted at <a href="https://github.com/Microsoft/DSCEA">https://github.com/Microsoft/DSCEA</a> and can be downloaded from the <a href="https://www.powershellgallery.com/packages/DSCEA">PowerShell Gallery</a>.

DSCEA documentation is hosted at <a href="https://microsoft.github.io/DSCEA">https://microsoft.github.io/DSCEA</a>

So, now that DSCEA is available, what does that mean for you?

DSCEA’s primary use case is to verify that your systems are actually configured the way you want them to be.

Real world examples of how DSCEA can be used include
<ul>
 	<li>Verifying a single setting, for example if a registry key is set appropriately across your entire environment</li>
 	<li>Auditing your systems to ensure that they meet the base level system configuration settings that are required to be a part of your environment</li>
 	<li>Scanning the systems in your environment against all of the items that make up your organization's security baseline</li>
 	<li>Verifying that settings configured via Group Policy are being applied correctly to the systems in your environment</li>
 	<li>Verifying settings configured on Windows Server 2016 Nano servers (which do not support Group Policy)</li>
</ul>
Let's take a look at the first example, to see how DSCEA can be used to verify that certain registry keys are set correctly on a group of systems in an environment.

First, you will need to install the DSCEA PowerShell module onto the computer that will act as your management system from where you will execute the scan from.  <a href="https://microsoft.github.io/DSCEA/mydoc_psgallery_install.html">Click here</a> for instructions on installing the DSCEA module.

Next, you need to create a DSC configuration that defines the desired state you would like to scan for.  Here is an example that defines a desired state for the security related crashonaudit registry key.

<!--DSCEARegistryTest1.ps1 Gist Reference-->
<script src="https://gist.github.com/rkyttle/f5a8a4c0ac0c97708d7bb72fb2164f33.js"></script>

Run the DSCEARegistryTest1.ps1 file, which creates an output file called localhost.mof in your current directory which you will then use to scan systems in your environment.

<a href="https://microsoft.github.io/DSCEA/mydoc_scan.html">Click here</a> for examples on how to execute a DSCEA scan.  One example is included below.
<h3><strong>Scan multiple systems for compliance to settings defined within a localhost.mof file located in your current directory</strong></h3>
<pre><code>PS C:\&gt; Start-DSCEAscan -MofFile .\localhost.mof -ComputerName dsctest-1, dsctest-2, dsctest-3</code></pre>
This command executes a DSCEA scan against 3 remote systems, dsctest-1, dsctest-2 and dsctest-3 using a locally defined MOF file that exists in the current directory. This MOF file specifies the settings to check for during the scan. Start-DSCEAscan returns a XML results file containing raw data that can be used with other functions, such as Get-DSCEAreport to create reports with consumable information.
<h3><strong>Generate HTML Reports based on scan results - System Compliance</strong></h3>
Once you have completed a scan, you will want to generate reports.  <a href="https://microsoft.github.io/DSCEA/mydoc_report_web.html">Click here</a> for instructions on creating HTML based reports with DSCEA.  Two examples are included below.
<pre><code>PS C:\Users\username\Documents\DSCEA&gt; Get-DSCEAreport -Overall</code></pre>
This command is executed from a directory that contains DSCEA scan result XML files. It generates a report of overall system compliance, and will mark a system as non-compliant if it does not fully match the desired configuration.
<h3><strong>Example HTML Report #1</strong></h3>
<a href="https://raw.githubusercontent.com/Microsoft/DSCEA/master/docs/images/OverallComplianceReport_Large.png"> <img alt="" src="https://raw.githubusercontent.com/Microsoft/DSCEA/master/docs/images/OverallComplianceReport_Small.png" /> </a>

Next we will use Get-DSCEAreport to generate a report showing all non-compliant items that were detected.
<pre><code>PS C:\Users\username\Documents\DSCEA&gt; Get-DSCEAreport -Detailed</code></pre>
This command is executed from a directory that contains DSCEA scan result XML files. It generates a report containing a list of all items that were found to be non-compliant. If all systems that are scanned are found to be compliant, this report will show no results.
<h3><strong>Example HTML Report #2</strong></h3>
<a href="https://raw.githubusercontent.com/Microsoft/DSCEA/master/docs/images/DetailedComplianceReport_Large.png"> <img alt="" src="https://raw.githubusercontent.com/Microsoft/DSCEA/master/docs/images/DetailedComplianceReport_Small.png" /> </a>
<h3><strong>Feeling creative?  DSCEA XML data can be converted into CSV, for use with other tools like PowerBI</strong></h3>
<a href="https://raw.githubusercontent.com/Microsoft/DSCEA/master/docs/images/PowerBIHome_Large.png"> <img alt="" src="https://raw.githubusercontent.com/Microsoft/DSCEA/master/docs/images/PowerBIHome_Small.png" /> </a>

&nbsp;

This post is just the first of many, as we will continue to explore the ways you can use DSCEA in your environment to verify that your systems are actually configured the way you want them to be.

DSCEA is an open source solution hosted on <a href="https://github.com/microsoft/dscea">GitHub</a>.  We look forward to your feedback and contributions!]]></content:encoded>
    </item>
    <item>
      <title>SQL MP Run As Accounts – NO LONGER REQUIRED - The Thought Process</title>
      <link>https://docs.microsoft.com/archive/blogs/ralphkyttle/sql-mp-run-as-accounts-no-longer-required-the-thought-process</link>
      <pubDate>Wed, 27 Apr 2016 19:45:00 GMT</pubDate>
      <dc:creator><![CDATA[Ralph Kyttle]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/ralphkyttle/2016/04/27/sql-mp-run-as-accounts-no-longer-required-the-thought-process/</guid>
      <description><![CDATA[If you are currently reading this, chances are you might have seen another post with a similar name...]]></description>
      <content:encoded><![CDATA[If you are currently reading this, chances are you might have seen another post with a similar name that Kevin Holman published on 4/26/16 <a href="https://blogs.technet.microsoft.com/kevinholman/2016/04/26/sql-mp-run-as-accounts-no-longer-required/">https://blogs.technet.microsoft.com/kevinholman/2016/04/26/sql-mp-run-as-accounts-no-longer-required/</a>

Kevin did an awesome job of explaining how we can use Service Security Identifiers (SID’s) to provide the SCOM agent service running on a SQL server with access to SQL and enable monitoring without creating having to create Run As accounts, distribute them and associate them with Run As profiles.

I want to take a few minutes to explain why I went looking for a better solution to Run As account management when it comes to SCOM and SQL monitoring, and how I came to the conclusion (with some help) that a solution based on Service SID's could be a better way to manage access from SCOM to SQL.

Due to the requirements of the SQL management pack, many are faced with the issue of creating and managing Run As accounts to provide SCOM with access into the SQL instances it is configured to monitor.  Kevin has wrote multiple posts on this in the past on ways to try to make this process a better experience.  I myself am currently involved in a deployment of SCOM 2012 R2 at my customer, and like many customers, mine has SQL in their environment.  Also, like many customers my customer has many security policies that need to be adhered to, including changing account passwords on a regular basis.  Knowing that I had multiple instances of SQL to monitor, I started to evaluate my options to make things work with as little overhead management as possible.

By default, SCOM agents run under the context of Local System.  This works fine for the Windows management pack, as Local System can provide SCOM with access to all of the items that the Windows MP requires access to.  However, when we get to working with the SQL management pack, the Local System account usually does not have all of the access needed to connect into our SQL instances to provide monitoring.  So why not just edit permissions on our SQL instances to allow the Local System account with the required rights needed in SQL?  The security concern with using NT AUTHORITY\SYSTEM is that all other services running in that security context will also gain access to the SQL instance.  This goes against the idea of providing least required privileges and it could be seen as a security risk.

Next, I looked at the idea of using the traditional method of creating a domain account, providing it with access to SQL and distributing the account via SCOM.  As I mentioned, my customer requires regular password resets on their accounts.  So maybe I'll try and make life easier and just create one domain account so I have less to manage and provide it with access to ALL of my SQL servers and distribute it to ALL of the servers via SCOM?  No, that won't work either, by doing this I'll have created an account that has way too much access, again violating least privileged access.  So am I stuck at this point with creating a new domain account for each SQL instance, and all that goes along with managing that process?  What about when new SQL servers come online and the management involved there?  This seemed like more than I wanted my customer to have to manage.

So I reached out to others at Microsoft to see how I could handle this situation with the least amount of effort in managing everything.  Through some of my questioning about providing the Local System account with the necessary rights, I got a response from Brandon Adams, a Microsoft Premier Field Engineer who suggested that I look into the Service SID solution.  I had not heard about using Service SID's to grant permissions to Windows Services before, but it sounded very intriguing.  Brandon shared with me the following link, <a href="https://support.microsoft.com/en-us/kb/2667175">https://support.microsoft.com/en-us/kb/2667175</a> which Kevin also highlighted in his post, that talks about how System Center Advisor requires a Service SID based solution in order to work.  While this article talks about providing the Service SID with sysadmin level access in SQL, it is possible to still follow the low privilege guidance found in the SCOM management pack guide when performing this configuration in SCOM.  Knowing little at the time about Service SID's, Brandon also provided me with the following link, <a href="https://blogs.technet.microsoft.com/askperf/2008/02/03/ws2008-windows-service-hardening/">https://blogs.technet.microsoft.com/askperf/2008/02/03/ws2008-windows-service-hardening/</a> which provides even more details about Service SID's from back when they were being introduced as a part of Windows Server 2008.

Armed with this knowledge, I began testing and was rewarded with a much easier experience than I was used to when I had managed the Run As accounts via service accounts from Active Directory.  Knowing the work Kevin has put into making the Run As experience better over the past many of years, I reached out to him to get his thoughts and feedback.  After some successful tests on his side, Kevin went and took it the next level, creating a custom management pack that helps to work through most of this new process directly from the SCOM console.  The management pack can be found here: <a href="https://gallery.technet.microsoft.com/SQL-Server-RunAs-Addendum-0c183c32">https://gallery.technet.microsoft.com/SQL-Server-RunAs-Addendum-0c183c32</a>

Hopefully now that you are armed with this information you will be able to increase your adoption of SQL monitoring in your environment, and this simpler process will make those conversations with database administrators about granting accounts with access all across the SQL environment a little bit easier.]]></content:encoded>
    </item>
    <item>
      <title>PowerShell - Passing Parameters as Variables using Remote Management and Invoke-Command</title>
      <link>https://docs.microsoft.com/archive/blogs/ralphkyttle/powershell-passing-parameters-as-variables-using-remote-management-and-invoke-command</link>
      <pubDate>Thu, 04 Jun 2015 10:51:13 GMT</pubDate>
      <dc:creator><![CDATA[Ralph Kyttle]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/ralphkyttle/2015/06/04/powershell-passing-parameters-as-variables-using-remote-management-and-invoke-command/</guid>
      <description><![CDATA[Recently I had a need to write a PowerShell script that could accept a set of parameters at script...]]></description>
      <content:encoded><![CDATA[<p>Recently I had a need to write a PowerShell script that could accept a set of parameters at script launch, and pass those parameters to an inline scriptblock to allow the input parameters to act as variables in a set of commands against a remote server.&nbsp; Looking at the documentation for the Invoke-Command cmdlet I saw that there was a parameter named ArgumentList, and looking at its description it seemed like the perfect fit for what I was looking to do.&nbsp; The description for ArgumentList states that it, &ldquo;Supplies the values of local variables in the command. The variables in the command are replaced by these values before the command is run on the remote computer. Enter the values in a comma-separated list. Values are associated with variables in the order that they are listed.&rdquo;</p>
<p>Looking at the syntax and examples for the ArgumentList parameter, I was unable to find any details for using it with a set of input parameters, so once I was able to pull something together that worked I figured it would be worth to share a full example of this functionality in action.</p>
<p>Example script basicremoting.ps1</p>
<div style="padding:5px;border:1px solid black;overflow:auto;font-family:Consolas,Lucida Console;font-size:10pt;">
<table border="0" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<td valign="Top">
<div style="background:#cecece;padding:5px;font-family:Consolas,Lucida Console;font-size:10pt;">001<br />002<br />003<br />004<br />005<br />006<br />007<br />008<br />009<br />010<br />011<br />012<br />013<br />014<br />015<br />016<br />017</div>
</td>
<td nowrap="nowrap" valign="Top">
<div style="background:#fcfcfc;padding:5px;font-family:Consolas,Lucida Console;font-size:10pt;"><span style="color:#006400;">#.\BasicRemoting.ps1 -remoteserver LAB01 -eventloginput Application -numinput 10</span><br /> <span style="color:#00008b;">Param</span><br /> <span style="color:#000000;">(</span><br /> <span style="color:#000000;">&nbsp;&nbsp;</span><span style="color:#008080;">[string]</span><span style="color:#ff4500;">$remoteserver</span><span style="color:#a9a9a9;">,</span><br /> <span style="color:#000000;">&nbsp;&nbsp;</span><span style="color:#008080;">[string]</span><span style="color:#ff4500;">$eventloginput</span><span style="color:#a9a9a9;">,</span><br /> <span style="color:#000000;">&nbsp;&nbsp;</span><span style="color:#008080;">[string]</span><span style="color:#ff4500;">$numinput</span><br /> <span style="color:#000000;">)</span><br /> <br /> <span style="color:#ff4500;">$ScriptBlockContent</span><span style="color:#000000;">&nbsp;</span><span style="color:#a9a9a9;">=</span><br /> <span style="color:#000000;">{</span><br /> <span style="color:#ff4500;">$eventlog</span><span style="color:#000000;">&nbsp;</span><span style="color:#a9a9a9;">=</span><span style="color:#000000;">&nbsp;</span><span style="color:#ff4500;">$args</span><span style="color:#a9a9a9;">[</span><span style="color:#800080;">0</span><span style="color:#a9a9a9;">]</span><br /> <span style="color:#ff4500;">$num</span><span style="color:#000000;">&nbsp;</span><span style="color:#a9a9a9;">=</span><span style="color:#000000;">&nbsp;</span><span style="color:#ff4500;">$args</span><span style="color:#a9a9a9;">[</span><span style="color:#800080;">1</span><span style="color:#a9a9a9;">]</span><br /> <span style="color:#0000ff;">get-eventlog</span><span style="color:#000000;">&nbsp;</span><span style="color:#000080;">-logname</span><span style="color:#000000;">&nbsp;</span><span style="color:#ff4500;">$eventlog</span><span style="color:#000000;">&nbsp;</span><span style="color:#000080;">-newest</span><span style="color:#000000;">&nbsp;</span><span style="color:#ff4500;">$num</span><br /> <span style="color:#000000;">}</span><br /> <br /> <span style="color:#0000ff;">Invoke-Command</span><span style="color:#000000;">&nbsp;</span><span style="color:#000080;">-Computer</span><span style="color:#000000;">&nbsp;</span><span style="color:#ff4500;">$remoteserver</span><span style="color:#000000;">&nbsp;</span><span style="color:#000080;">-ScriptBlock</span><span style="color:#000000;">&nbsp;</span><span style="color:#ff4500;">$ScriptBlockContent</span><span style="color:#000000;">&nbsp;</span><span style="color:#000080;">-ArgumentList</span><span style="color:#000000;">&nbsp;</span><span style="color:#ff4500;">$eventloginput</span><span style="color:#a9a9a9;">,</span><span style="color:#000000;">&nbsp;</span><span style="color:#ff4500;">$numinput</span><br /> <span style="color:#006400;">#End</span></div>
</td>
</tr>
</tbody>
</table>
</div>]]></content:encoded>
    </item>
    <item>
      <title>SharePoint - SharePoint 2010 and Remote PowerShell for use with System Center Orchestrator 2012</title>
      <link>https://docs.microsoft.com/archive/blogs/ralphkyttle/sharepoint-sharepoint-2010-and-remote-powershell-for-use-with-system-center-orchestrator-2012</link>
      <pubDate>Mon, 18 May 2015 13:51:00 GMT</pubDate>
      <dc:creator><![CDATA[Ralph Kyttle]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/ralphkyttle/2015/05/18/sharepoint-sharepoint-2010-and-remote-powershell-for-use-with-system-center-orchestrator-2012/</guid>
      <description><![CDATA[Today we will be taking a look at how to enable a PowerShell script to execute SharePoint cmdlets on...]]></description>
      <content:encoded><![CDATA[<p><span style="font-size:small;"><span style="font-family:Calibri;">Today we will be taking a look at how to enable a PowerShell script to execute SharePoint cmdlets on a remote server running SharePoint 2010 for use with System Center Orchestrator 2012.&nbsp; You may be thinking, &ldquo;That&rsquo;s sounds simple, I can use PowerShell to remotely execute SharePoint cmdlets using New-PSSession and Invoke-Command.&rdquo;&nbsp; And while you would be right, running commands in a PSSession on a remote computer will start an interactive session on that remote computer.&nbsp; This may work fine in day to day </span><span style="font-family:Calibri;">PowerShell based system</span><span style="font-family:Calibri;"> administration, but interactive sessions do not work as well when we are trying to automate, which is what we are looking to do with System Center Orchestrator.</span></span><span style="font-family:Calibri;">&nbsp;</span></p>
<p><span style="font-family:Calibri;font-size:small;">To configure things to be non-interactive and not require an administrator to be at a keyboard for the script to complete successfully, I have chosen to simply use the Invoke-Command cmdlet on its own.&nbsp; If you utilize PowerShell throughout your day, hopefully you are running the latest production release, PowerShell version 4.&nbsp; If you are running PowerShell version 4 and are looking to get this to work, some additional configuration is needed on each SharePoint server that you want to run remote commands against.</span></p>
<p><span style="font-family:Calibri;font-size:small;">Assuming that you have configured WinRM and your remote SharePoint server is capable of handling PowerShell remote commands, we will start with a simple example that should work without any additional configuration:</span></p>
<p style="margin-left:30px;"><span style="font-family:Calibri;font-size:small;">Invoke-Command -Computer SP2010 &ndash;ScriptBlock {<br />Get-Host<br />}</span></p>
<p><span style="font-family:Calibri;font-size:small;">Saving the above code as a ps1 file allows us to run this simple PowerShell script against a remote computer called SP2010 from our management server.&nbsp; It is always a good first step to ensure that your script works properly outside of your automation environment before you try to add it in, so I do all my testing first just against the ps1 files themselves.</span></p>
<p><span style="font-family:Calibri;font-size:small;">Let&rsquo;s dig deeper now that we know remoting is working, and let&rsquo;s come up with a simple script that utilizes a SharePoint cmdlet</span></p>
<p style="margin-left:30px;"><span style="font-family:Calibri;font-size:small;">Invoke-Command -Computer SP2010 &ndash;ScriptBlock {<br />Add-PSSnapin Microsoft.SharePoint.PowerShell<br />$farm = Get-SPFarm<br />}</span></p>
<p><span style="font-family:Calibri;font-size:small;">If you are up to date with PowerShell and running version 4 throughout your environment, the above command will fail.&nbsp; The reason is that the SharePoint snapin that is referenced is not compatible with version 4 of the .Net Runtime, which is used by default in PowerShell version 4.&nbsp; You may have come across this already as well and you may be thinking, &ldquo;I already have a way to fix this, I just need to run powershell -v 2 before I go to add the snapin.&rdquo;&nbsp; And again you would be right, except this only works in an interactive session.&nbsp; Since we are trying to do this non-interactively so it can be run any time by Orchestrator, we need to find a different solution.&nbsp; The issue with this comes up when we try to run the Invoke-Command cmdlet, as the Invoke-Command will never complete when the powershell &ndash;v 2 option is included in your script.</span></p>
<p><span style="font-size:small;"><span style="font-family:Calibri;">This led me to do some searching, and I came across the following article by Cyril Leroy </span><a href="https://www.gsx.com/blog/bid/86424/Allow-Remote-PowerShell-on-SharePoint-2010-and-PowerShell-v3" target="_blank"><span style="color:#0563c1;font-family:Calibri;">https://www.gsx.com/blog/bid/86424/Allow-Remote-PowerShell-on-SharePoint-2010-and-PowerShell-v3</span></a><span style="font-family:Calibri;"> </span></span></p>
<p><span style="font-family:Calibri;font-size:small;">In their post, Cyril demonstrates the <a title="Set-PSSessionConfiguration" href="https://technet.microsoft.com/en-us/library/hh849726(v=wps.630).aspx" target="_blank">Set-PSSessionConfiguration</a> cmdlet.&nbsp; Using this cmdlet, we can force a computer to use a desired version of PowerShell when we connect into it to execute remote commands.</span></p>
<p><span style="font-family:Calibri;font-size:small;">On each SharePoint 2010 server that has PowerShell version 4 installed, we will run the following command to force the server to run remote commands using PowerShell version 2.&nbsp; While this seems similar to the powershell &ndash;v 2 command we talked about earlier, the difference here is that this configuration will still allow us to run the Invoke-Command cmdlet.</span></p>
<p style="margin-left:30px;"><span style="font-family:Calibri;font-size:small;">Set-PSSessionConfiguration -Name microsoft.powershell -PSVersion &quot;2.0&quot;</span></p>
<p><span style="font-family:Calibri;font-size:small;">Upon running this command, we can head back over to our management server and run our script that contains <span style="font-family:Calibri;">our SharePoint cmdlets</span> and the Invoke-Command to our remote SharePoint server and things should now&nbsp;complete successfully.</span></p>]]></content:encoded>
    </item>
    <item>
      <title>Azure - Add an Azure virtual machine to an Active Directory domain that exists on-prem</title>
      <link>https://docs.microsoft.com/archive/blogs/ralphkyttle/azure-add-an-azure-virtual-machine-to-an-active-directory-domain-that-exists-on-prem</link>
      <pubDate>Sat, 10 Jan 2015 19:34:00 GMT</pubDate>
      <dc:creator><![CDATA[Ralph Kyttle]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/ralphkyttle/2015/01/10/azure-add-an-azure-virtual-machine-to-an-active-directory-domain-that-exists-on-prem/</guid>
      <description><![CDATA[The following information&nbsp;was inspired by another post by one of my colleagues, Diego...]]></description>
      <content:encoded><![CDATA[<p>The following information&nbsp;was inspired by another post by one of my colleagues, Diego Viso.&nbsp; A few months ago,&nbsp;Diego put up a great post called <a title="Creating a site to site (S2S) VPN to Azure with RRAS, one physical NIC and a NAT gateway" href="/b/diegoviso/archive/2014/10/28/creating-a-site-to-site-s2s-vpn-to-azure-with-rras-and-one-physical-nic.aspx">Creating a site to site (S2S) VPN to Azure with RRAS, one physical NIC and a NAT gateway</a></p>
<p>In that post,&nbsp;Diego&nbsp;provided a great example&nbsp;of using&nbsp;the Routing and Remote Access Service (RRAS) that is built into Windows Server 2012 R2 to setup a site to site (S2S) VPN to an Azure subscription.&nbsp; In regards to Azure, the benefit of a S2S VPN is that it allows you to extend your on-prem network to a virtual network hosted&nbsp;in your Azure subscription.&nbsp; By extending your network, you can extend your data center and build machines in your Azure environment and integrate those machines directly with your on-prem environment.&nbsp; RRAS is a supported mechanism for setting up&nbsp;a S2S VPN, but it&nbsp;has requirements that can prove difficult for small lab environments, like requiring&nbsp;multiple public&nbsp;IP addresses.&nbsp; This caused RRAS to be less than ideal in lab type scenarios, especially home labs.&nbsp; I found Diego&#39;s solution to the issues posed by these requirements to&nbsp;be very helpful as it allowed me to setup a VPN connection using NAT IP&#39;s from my on-prem environment up to the virtual machines I have running in my Azure subscription.&nbsp; This is really the first requirement that had to be met in order to add Azure machines to my on-prem hosted domain, because in order to be members of the domain, a network connection tying my on-prem environment to the machines hosted in my Azure subscription had to exist.&nbsp; I had put this off for a while, as I didn&#39;t want to invest in a new piece of hardware to enable the VPN, and while running a VM with the RRAS role&nbsp;was supported, I did not want to invest in purchasing multiple static IP&#39;s from my ISP.&nbsp; Upon finding Diego&#39;s example I had everything I needed to proceed with S2S VPN testing using RRAS&nbsp;in my home lab.</p>
<p>While the solution Diego explained would not be appropriate for a production environment, it should more than fit the need for most small lab environments, and it did everything I needed to get things up and running in my home lab.</p>
<p>Continuing from the end of Diego&#39;s post, the next steps I had to complete involved configuring a static route for machines in my on-prem network, to tell them to use the NIC labeled &quot;Internal&quot; on my RRAS server as the gateway to reach machines that were being hosted in my Azure subscription.&nbsp;&nbsp;Following Diego&#39;s post,&nbsp;the VPN connection had been established between my on-prem environment and my Azure subscription, but I was only able to communicate to and from my Azure VM&#39;s with my RRAS server.&nbsp; It was not until I configured the static route&nbsp;on my core router in my on-prem&nbsp;environment that I could reach all of my on-prem resources from my Azure VM, most importantly being my on-prem domain controllers.</p>
<p>Additionally, I configured my Azure network with the&nbsp;IP of my on-prem DNS server so that&nbsp;when machines were created in Azure that were part of my virtual network,&nbsp;they would automatically get my on-prem DNS server as a DNS server in their network configuration.&nbsp; This is important so that when I try to add a machine to my on-prem hosted domain, the server in Azure that is being added to the domain has the ability to resolve the domain name properly.</p>
<p>With these steps completed, I was able to successfully join one of my machines hosted&nbsp;in Azure to my domain hosted solely on-prem, and begin managing that machine just as I would any other server in my on-prem environment.&nbsp; For me, the biggest hurdle I had to overcome was the static route configuration, so if you are looking to get this setup I hope this information can be useful to you!</p>]]></content:encoded>
    </item>
    <item>
      <title>SCOM 2012 R2 - Use PowerShell to end an active maintenance mode</title>
      <link>https://docs.microsoft.com/archive/blogs/ralphkyttle/scom-2012-r2-use-powershell-to-end-an-active-maintenance-mode</link>
      <pubDate>Mon, 10 Nov 2014 20:02:00 GMT</pubDate>
      <dc:creator><![CDATA[Ralph Kyttle]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/ralphkyttle/2014/11/10/scom-2012-r2-use-powershell-to-end-an-active-maintenance-mode/</guid>
      <description><![CDATA[The following information&nbsp;was inspired by another post by one of my colleagues, Neil...]]></description>
      <content:encoded><![CDATA[<p>The following information&nbsp;was inspired by another post by one of my colleagues, Neil Peterson.&nbsp; Last year, Neil put up a great post called <a href="/b/neilp/archive/2013/06/17/integrating-cluster-aware-updating-with-operations-manager-maintenance-mode-pre-and-post-update-scripts.aspx"><span style="color:#0563c1;">Integrating Cluster Aware Updating with Operations Manager Maintenance Mode &ndash; Pre and Post Update Scripts</span></a></p>
<p>In that post, Neil explained how we could use PowerShell to place cluster nodes into maintenance mode in Operations Manager when a Cluster Aware Update job was run.&nbsp; Neil looked at placing a cluster node into Operations Manager maintenance mode, and in this post I will show how we can take a node out of maintenance mode once it has finished applying updates.</p>
<p>In the screenshot from Neil&rsquo;s post below, we see that he setup an Updating Run Profile that specified a PowerShell PS1 file to act as a PreUpdateScript.&nbsp; This PS1 file was written to place the node being updated by Cluster Aware Updating&nbsp;into Operations Manager maintenance mode.&nbsp; For our purposes, we will show how to create a new PS1 file to take a node out of maintenance mode once updating has completed.&nbsp; Our goal is to restore monitoring on the cluster node as soon as possible once updating has finished for that node.&nbsp; We would look to include this new PS1 file as our <b>PostUpdateScript</b> in our Updating Run Profile.&nbsp; Without the PostUpdateScript, the node will stay in maintenance mode for the entire period that was specified in the <b>PreUpdateScript</b>, unless an administrator ends the maintenance mode early.&nbsp; Through this example we look to show how that can be handled automatically.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/02/93/screenshot.jpg" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-02-93/screenshot.jpg"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/02/93/screenshot.jpg" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-02-93/screenshot.jpg" border="0" /></a></p>
<p>Looking at the PowerShell code provided by Neil, I saw it included the <b>start-scommaintenancemode </b>cmdlet.&nbsp; So in my first attempts to setup the PostUpdateScript, I looked to see if I could find a <b>stop-scommaintenancemode</b> cmdlet.&nbsp; Sadly it was not that easy, as such a cmdlet does not exist.&nbsp; But the silver lining is that it gave me a reason to put together this post, and hopefully help others out looking for a solution to this.</p>
<p>Through some research, I learned that while there is not a stop-scommaintenancemode cmdlet, there is a StopMaintenanceMode method.&nbsp; Using the following <a href="https://blogs.msdn.com/b/boris_yanushpolsky/archive/2007/08/30/stoping-maintenance-mode.aspx"><span style="color:#0563c1;">example</span></a> from Boris Yanushpolsky for SCOM 2007, I found that the StopMaintenanceMode method is still valid in Operations Manager 2012 R2, and I was able to borrow the following code from Boris&rsquo; post:</p>
<p>$computer.StopMaintenanceMode([System.DateTime]::Now.ToUniversalTime(),[Microsoft.EnterpriseManagement.Common.TraversalDepth]::Recursive);</p>
<p>This method allowed me to end an active Operations Manager maintenance mode immediately, and the recursive setting ensured that all monitors underneath the Windows Computer object exited maintenance mode as well.</p>
<p>Full code to my PostUpdateScript PS1 file:</p>
<p style="margin-left:30px;">$secpasswd = ConvertTo-SecureString &quot;&lt;Password&gt;&quot; -AsPlainText -Force</p>
<p style="margin-left:30px;">$mycreds = New-Object System.Management.Automation.PSCredential (&quot;&lt;DOMAIN\user&gt;&quot;, $secpasswd)</p>
<p style="margin-left:30px;">$ComputerName = [System.Net.Dns]::GetHostByName(($env:computerName)).HostName.ToString()</p>
<p style="margin-left:30px;">Invoke-Command -ComputerName &lt;SCOMServer&gt; -Credential $mycreds -ScriptBlock {</p>
<p style="margin-left:30px;">&nbsp;&nbsp;&nbsp;import-module operationsmanager</p>
<p style="margin-left:30px;">&nbsp;&nbsp;&nbsp;$class = get-scomclass -name:&rsquo;Microsoft.Windows.Computer&rsquo;</p>
<p style="margin-left:30px;">&nbsp;&nbsp;&nbsp;$computer = get-scomclassinstance -class $class | where{$_.name -eq $using:ComputerName}</p>
<p style="margin-left:30px;">&nbsp;&nbsp; $computer.StopMaintenanceMode([DateTime]::Now.ToUniversalTime(),[Microsoft.EnterpriseManagement.Common.TraversalDepth]::Recursive);</p>
<p style="margin-left:30px;">}</p>
<p>This code can then be saved as a PS1 file, and specified in an Updating Run Profile as a PostUpdateScript.&nbsp; This is just a small example of what is possible using PowerShell to customize updates via the Cluster Aware Updates option, but I hope you found it useful!</p>
<p></p>]]></content:encoded>
    </item>
  </channel>
</rss>