<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Powershell on Ru Campbell MVP</title>
    <link>https://campbell.scot/tags/powershell/</link>
    <description>Recent content in Powershell on Ru Campbell MVP</description>
    <generator>Hugo</generator>
    <language>en-gb</language>
    <lastBuildDate>Sat, 26 Jun 2021 19:23:38 +0000</lastBuildDate>
    <atom:link href="https://campbell.scot/tags/powershell/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Reauthorise Windows Server DHCP with One Line of PowerShell</title>
      <link>https://campbell.scot/reauthorise-windows-server-dhcp/</link>
      <pubDate>Sat, 26 Jun 2021 19:23:38 +0000</pubDate>
      <guid>https://campbell.scot/reauthorise-windows-server-dhcp/</guid>
      <description>&lt;p&gt;This will be a brief blog, as I am certainly not a DHCP expert or day-to-day administrator.  I do, however, run a DHCP server on Windows Server 2019 constantly in my lab environment, but sometimes encounter a problem whereby the server is no longer authorised, and when I use the GUI to do so, I get the error &lt;strong&gt;the specified servers are already present in the directory service&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img loading=&#34;lazy&#34; src=&#34;https://campbell.scot/wp-content/uploads/2021/06/the-specified-servers-are-already-present-in-the-directory-service.png&#34;&gt;&lt;/p&gt;
&lt;p&gt;The PowerShell I use to resolve this does the following:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Microsoft Defender Antivirus – Schedule &amp; Install Updates via Network Shares</title>
      <link>https://campbell.scot/microsoft-defender-antivirus-schedule-install-updates-via-network-shares/</link>
      <pubDate>Sat, 13 Mar 2021 21:28:12 +0000</pubDate>
      <guid>https://campbell.scot/microsoft-defender-antivirus-schedule-install-updates-via-network-shares/</guid>
      <description>&lt;p&gt;Although not common, there are scenarios out where you will have LAN-only devices onboarded in Microsoft Defender for Endpoint (MDE), or at least using Microsoft Defender Antivirus (MDAV).  With no line of sight to the internet, you can use options such as WSUS, but in this blog, I&amp;rsquo;ll explore using a network share, as WSUS isn&amp;rsquo;t always an option.&lt;/p&gt;
&lt;h2 id=&#34;set-up-the-network-share-for-updates&#34;&gt;Set up the network share for updates&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Create a directory on your file server with subdirectories for the different CPU architectures you&amp;rsquo;ll be supporting.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img loading=&#34;lazy&#34; src=&#34;https://campbell.scot/wp-content/uploads/2021/02/01-create-update-folders-on-server.png&#34;&gt;2. On the server, we&amp;rsquo;ll be installing a script provided by Microsoft.  In PowerShell with elevated rights:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Use Intune to Manage Microsoft Defender for Endpoint Tags and Device Groups</title>
      <link>https://campbell.scot/use-intune-to-manage-microsoft-defender-for-endpoint-tags-and-device-groups/</link>
      <pubDate>Thu, 11 Feb 2021 21:24:59 +0000</pubDate>
      <guid>https://campbell.scot/use-intune-to-manage-microsoft-defender-for-endpoint-tags-and-device-groups/</guid>
      <description>&lt;p&gt;In &lt;strong&gt;Microsoft Defender for Endpoint&lt;/strong&gt; (MDE), &lt;strong&gt;tags&lt;/strong&gt; can be attached to a device for reporting, filtering, and as a dynamic attribute for membership of a &lt;strong&gt;device&lt;/strong&gt; &lt;strong&gt;group&lt;/strong&gt;.  Device groups (previously machine groups), are used to assign devices different rules and administrative ownership.  A device can only belong to one group and controls settings such as auto-remediation level and which Role-Based Access Control (RBAC) roles have administrative permissions over it.&lt;/p&gt;
&lt;p&gt;While you can assign tags, and therefore determine group membership, manually from the Security Center, this doesn&amp;rsquo;t exactly scale well.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Store BitLocker Recovery Keys in Azure AD for Devices Already Encrypted</title>
      <link>https://campbell.scot/store-bitlocker-recovery-keys-in-azure-ad-for-devices-already-encrypted/</link>
      <pubDate>Fri, 15 Jan 2021 18:18:36 +0000</pubDate>
      <guid>https://campbell.scot/store-bitlocker-recovery-keys-in-azure-ad-for-devices-already-encrypted/</guid>
      <description>&lt;p&gt;As you move from on-premises or third-party infrastructure to Microsoft 365 and Azure AD, you will want to keep those BitLocker recovery keys safe.  You can store those keys either in on-premises Active Directory or in the cloud with Azure AD.&lt;/p&gt;
&lt;p&gt;The behavior of the BitLocker / Azure AD relationship is that the recovery keys will only be stored against the device object in Azure AD if the encryption happens when the device is already Azure AD or Hybrid Azure AD Joined.  You can then retrieve the recovery keys from the Azure AD portal or Microsoft Endpoint Manager (which really just takes you back to Azure AD&amp;rsquo;s properties for the device).&lt;/p&gt;</description>
    </item>
    <item>
      <title>PowerShell: Run Cmdlet If Another Was Successful (And Keep Trying Until It Is)</title>
      <link>https://campbell.scot/powershell-run-cmdlet-if-another-was-successful-and-keep-trying-until-it-is/</link>
      <pubDate>Fri, 23 Oct 2020 17:30:52 +0000</pubDate>
      <guid>https://campbell.scot/powershell-run-cmdlet-if-another-was-successful-and-keep-trying-until-it-is/</guid>
      <description>&lt;p&gt;Today I&amp;rsquo;m sharing a useful bit of PowerShell I gracelessly punt from script to script whenever I need to make sure a prerequisite it met before running something and to &lt;em&gt;keep checking&lt;/em&gt; until it&amp;rsquo;s met, then run what I need: &amp;ldquo;do X when Y is ready and keep checking Y until it&amp;rsquo;s ready&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;The original use for this was my script to create a new Microsoft 365 user, but hold off on some parts of it - such as time zone settings - until the Exchange Online mailbox is provisioned.  That takes some time, so I wanted to keep checking and as soon as I could, continue the script.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
