<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Script Dumpster - Series - pr0mpt</title><link>https://www.pr0mpt.com/series/script-dumpster/</link><description>Script Dumpster - Series - pr0mpt</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Fri, 30 Jun 2017 12:42:25 +0200</lastBuildDate><atom:link href="https://www.pr0mpt.com/series/script-dumpster/" rel="self" type="application/rss+xml"/><item><title>Script Dumpster</title><link>https://www.pr0mpt.com/2015-08-19-script-dumpster/</link><pubDate>Wed, 19 Aug 2015 22:42:36 +0200</pubDate><author><name>Robert Prüst</name><uri>https://pr0mpt.com</uri></author><guid>https://www.pr0mpt.com/2015-08-19-script-dumpster/</guid><description><![CDATA[<p>At my job I tend to have quiet and busy periods, just like everyone else.</p>
<p>At some times I even have very busy periods… like now.
Because of that I tend to not have time or motivation to do any blogging, but that doesn&rsquo;t mean I&rsquo;m not doing anything productive.</p>
<p>Because of that I thought &ldquo;why not just share the work I&rsquo;m creating?&rdquo;.</p>
<h1 id="an-idea-was-born" class="headerLink">
    <a href="#an-idea-was-born" class="header-mark"></a>An idea was born….</h1><p>Then it hit me..</p>]]></description></item><item><title>Script Dumpster: Get-AutoStartService</title><link>https://www.pr0mpt.com/2015-08-19-script-dumpster-get-autostartservice/</link><pubDate>Wed, 19 Aug 2015 22:41:46 +0200</pubDate><author><name>Robert Prüst</name><uri>https://pr0mpt.com</uri></author><guid>https://www.pr0mpt.com/2015-08-19-script-dumpster-get-autostartservice/</guid><description><![CDATA[<h1 id="the-problem" class="headerLink">
    <a href="#the-problem" class="header-mark"></a>The Problem</h1><p>A frequent issue on servers is when services that are supposed to start simply haven&rsquo;t started.</p>
<p>There&rsquo;s a simple one-liner that can show you the services that meet these requirements for you:</p>
<div class="code-block highlight is-open show-line-numbers  tw:group tw:my-2">
  <div class="
    
    tw:flex 
    tw:flex-row
    tw:flex-1 
    tw:justify-between 
    tw:w-full tw:bg-bgColor-secondary
    ">      
    <button 
      class="
        code-block-button
        tw:mx-2 
        tw:flex
        tw:flex-row
        tw:flex-1"
      aria-hidden="true">
          <span class="tw:group-[.is-open]:rotate-90 tw:transition-[transform] tw:duration-500 tw:ease-in-out tw:print:hidden! tw:w-min tw:h-min tw:my-1 tw:mx-1"><svg class="icon"
    xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"/></svg></span>
          <span class="tw:select-none tw:my-1! tw:block">powershell</span>
      </button>

   <div class="tw:flex">
      <button 
        class="
          line-number-button
          tw:mx-2 
          tw:hidden 
          tw:group-[.is-open]:block 
          tw:group-[.show-line-numbers]:text-fgColor-link 
          tw:print:hidden!" 
        title="Toggle line numbers"><svg class="icon"
    xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M61.77 401l17.5-20.15a19.92 19.92 0 0 0 5.07-14.19v-3.31C84.34 356 80.5 352 73 352H16a8 8 0 0 0-8 8v16a8 8 0 0 0 8 8h22.83a157.41 157.41 0 0 0-11 12.31l-5.61 7c-4 5.07-5.25 10.13-2.8 14.88l1.05 1.93c3 5.76 6.29 7.88 12.25 7.88h4.73c10.33 0 15.94 2.44 15.94 9.09 0 4.72-4.2 8.22-14.36 8.22a41.54 41.54 0 0 1-15.47-3.12c-6.49-3.88-11.74-3.5-15.6 3.12l-5.59 9.31c-3.72 6.13-3.19 11.72 2.63 15.94 7.71 4.69 20.38 9.44 37 9.44 34.16 0 48.5-22.75 48.5-44.12-.03-14.38-9.12-29.76-28.73-34.88zM496 224H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0-160H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16V80a16 16 0 0 0-16-16zm0 320H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zM16 160h64a8 8 0 0 0 8-8v-16a8 8 0 0 0-8-8H64V40a8 8 0 0 0-8-8H32a8 8 0 0 0-7.14 4.42l-8 16A8 8 0 0 0 24 64h8v64H16a8 8 0 0 0-8 8v16a8 8 0 0 0 8 8zm-3.91 160H80a8 8 0 0 0 8-8v-16a8 8 0 0 0-8-8H41.32c3.29-10.29 48.34-18.68 48.34-56.44 0-29.06-25-39.56-44.47-39.56-21.36 0-33.8 10-40.46 18.75-4.37 5.59-3 10.84 2.8 15.37l8.58 6.88c5.61 4.56 11 2.47 16.12-2.44a13.44 13.44 0 0 1 9.46-3.84c3.33 0 9.28 1.56 9.28 8.75C51 248.19 0 257.31 0 304.59v4C0 316 5.08 320 12.09 320z"/></svg></button>

      <button 
        class="
          wrap-code-button
          tw:select-none 
          tw:mx-2 
          tw:hidden 
          tw:group-[.is-open]:block 
          tw:group-[.is-wrap]:text-fgColor-link 
          tw:print:hidden!" 
        title="Toggle code wrap"><svg class="icon"
    xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"/></svg></button>
      
      <button 
        class="
          copy-code-button
          tw:select-none
          tw:mx-2 
          tw:hidden
          tw:group-[.is-open]:block
          tw:hover:text-fgColor-link 
          tw:print:hidden!"
        title="Copy code">
          <span class="copy-icon tw:block"><svg class="icon"
    xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M433.941 65.941l-51.882-51.882A48 48 0 0 0 348.118 0H176c-26.51 0-48 21.49-48 48v48H48c-26.51 0-48 21.49-48 48v320c0 26.51 21.49 48 48 48h224c26.51 0 48-21.49 48-48v-48h80c26.51 0 48-21.49 48-48V99.882a48 48 0 0 0-14.059-33.941zM266 464H54a6 6 0 0 1-6-6V150a6 6 0 0 1 6-6h74v224c0 26.51 21.49 48 48 48h96v42a6 6 0 0 1-6 6zm128-96H182a6 6 0 0 1-6-6V54a6 6 0 0 1 6-6h106v88c0 13.255 10.745 24 24 24h88v202a6 6 0 0 1-6 6zm6-256h-64V48h9.632c1.591 0 3.117.632 4.243 1.757l48.368 48.368a6 6 0 0 1 1.757 4.243V112z"/></svg></span>
          <span class="check-icon tw:hidden"><svg class="icon"
    xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"/></svg></span>
      </button>
        
      <button 
        class="
          tw:select-none 
          tw:mx-2 
          tw:block 
          tw:group-[.is-open]:hidden 
          tw:print:hidden!" 
        disabled
        aria-hidden="true"><svg class="icon"
    xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M328 256c0 39.8-32.2 72-72 72s-72-32.2-72-72 32.2-72 72-72 72 32.2 72 72zm104-72c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72zm-352 0c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72z"/></svg></button>
    </div>
  </div>
  <pre style="counter-reset: codeblock;" class="tw:block tw:m-0 tw:p-0"><code 
    id="codeblock-id-1" 
    class="
      chroma 
      tw:block! 
      tw:p-0
      tw:m-0
      tw:transition-[max-height] 
      tw:duration-500 
      tw:ease-in-out 
      tw:group-[.is-closed]:max-h-0! 
      tw:group-[.is-wrap]:text-wrap
      tw:overflow-y-hidden
      tw:overflow-x-auto
      tw:scrollbar-thin
      "><span class="line"><span class="cl"><span class="nb">Get-WmiObject</span> <span class="n">-Class</span> <span class="n">Win32_Service</span> <span class="n">-Filter</span> <span class="s2">&#34;Startmode = &#39;Auto&#39; AND State = &#39;Stopped&#39; AND ExitCode != 0&#34;</span></span></span></code></pre>
</div>
<p>Want to directly start up these services? Not a problem!</p>]]></description></item><item><title>Script Dumpster: Merge-CSV</title><link>https://www.pr0mpt.com/2015-08-20-script-dumpster-merge-csv/</link><pubDate>Thu, 20 Aug 2015 13:00:57 +0200</pubDate><author><name>Robert Prüst</name><uri>https://pr0mpt.com</uri></author><guid>https://www.pr0mpt.com/2015-08-20-script-dumpster-merge-csv/</guid><description><![CDATA[<h1 id="the-problem" class="headerLink">
    <a href="#the-problem" class="header-mark"></a>The Problem</h1><p>A customer required the inventory of product keys for various products on all network systems.
I had used a tool which scanned all machines and nicely produced a .csv file for each machine it had scanned.</p>
<p>Ideally I wanted to have a single .csv file which I could then filter against, either using Excel or PowerShell.</p>
<h1 id="the-function" class="headerLink">
    <a href="#the-function" class="header-mark"></a>The Function</h1><p>Check the examples notes on how to use the function.</p>
<div class="code-block highlight is-closed show-line-numbers  tw:group tw:my-2">
  <div class="
    
    tw:flex 
    tw:flex-row
    tw:flex-1 
    tw:justify-between 
    tw:w-full tw:bg-bgColor-secondary
    ">      
    <button 
      class="
        code-block-button
        tw:mx-2 
        tw:flex
        tw:flex-row
        tw:flex-1"
      aria-hidden="true">
          <span class="tw:group-[.is-open]:rotate-90 tw:transition-[transform] tw:duration-500 tw:ease-in-out tw:print:hidden! tw:w-min tw:h-min tw:my-1 tw:mx-1"><svg class="icon"
    xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"/></svg></span>
          <span class="tw:select-none tw:my-1! tw:block">powershell</span>
      </button>

   <div class="tw:flex">
      <button 
        class="
          line-number-button
          tw:mx-2 
          tw:hidden 
          tw:group-[.is-open]:block 
          tw:group-[.show-line-numbers]:text-fgColor-link 
          tw:print:hidden!" 
        title="Toggle line numbers"><svg class="icon"
    xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M61.77 401l17.5-20.15a19.92 19.92 0 0 0 5.07-14.19v-3.31C84.34 356 80.5 352 73 352H16a8 8 0 0 0-8 8v16a8 8 0 0 0 8 8h22.83a157.41 157.41 0 0 0-11 12.31l-5.61 7c-4 5.07-5.25 10.13-2.8 14.88l1.05 1.93c3 5.76 6.29 7.88 12.25 7.88h4.73c10.33 0 15.94 2.44 15.94 9.09 0 4.72-4.2 8.22-14.36 8.22a41.54 41.54 0 0 1-15.47-3.12c-6.49-3.88-11.74-3.5-15.6 3.12l-5.59 9.31c-3.72 6.13-3.19 11.72 2.63 15.94 7.71 4.69 20.38 9.44 37 9.44 34.16 0 48.5-22.75 48.5-44.12-.03-14.38-9.12-29.76-28.73-34.88zM496 224H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0-160H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16V80a16 16 0 0 0-16-16zm0 320H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zM16 160h64a8 8 0 0 0 8-8v-16a8 8 0 0 0-8-8H64V40a8 8 0 0 0-8-8H32a8 8 0 0 0-7.14 4.42l-8 16A8 8 0 0 0 24 64h8v64H16a8 8 0 0 0-8 8v16a8 8 0 0 0 8 8zm-3.91 160H80a8 8 0 0 0 8-8v-16a8 8 0 0 0-8-8H41.32c3.29-10.29 48.34-18.68 48.34-56.44 0-29.06-25-39.56-44.47-39.56-21.36 0-33.8 10-40.46 18.75-4.37 5.59-3 10.84 2.8 15.37l8.58 6.88c5.61 4.56 11 2.47 16.12-2.44a13.44 13.44 0 0 1 9.46-3.84c3.33 0 9.28 1.56 9.28 8.75C51 248.19 0 257.31 0 304.59v4C0 316 5.08 320 12.09 320z"/></svg></button>

      <button 
        class="
          wrap-code-button
          tw:select-none 
          tw:mx-2 
          tw:hidden 
          tw:group-[.is-open]:block 
          tw:group-[.is-wrap]:text-fgColor-link 
          tw:print:hidden!" 
        title="Toggle code wrap"><svg class="icon"
    xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"/></svg></button>
      
      <button 
        class="
          copy-code-button
          tw:select-none
          tw:mx-2 
          tw:hidden
          tw:group-[.is-open]:block
          tw:hover:text-fgColor-link 
          tw:print:hidden!"
        title="Copy code">
          <span class="copy-icon tw:block"><svg class="icon"
    xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M433.941 65.941l-51.882-51.882A48 48 0 0 0 348.118 0H176c-26.51 0-48 21.49-48 48v48H48c-26.51 0-48 21.49-48 48v320c0 26.51 21.49 48 48 48h224c26.51 0 48-21.49 48-48v-48h80c26.51 0 48-21.49 48-48V99.882a48 48 0 0 0-14.059-33.941zM266 464H54a6 6 0 0 1-6-6V150a6 6 0 0 1 6-6h74v224c0 26.51 21.49 48 48 48h96v42a6 6 0 0 1-6 6zm128-96H182a6 6 0 0 1-6-6V54a6 6 0 0 1 6-6h106v88c0 13.255 10.745 24 24 24h88v202a6 6 0 0 1-6 6zm6-256h-64V48h9.632c1.591 0 3.117.632 4.243 1.757l48.368 48.368a6 6 0 0 1 1.757 4.243V112z"/></svg></span>
          <span class="check-icon tw:hidden"><svg class="icon"
    xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"/></svg></span>
      </button>
        
      <button 
        class="
          tw:select-none 
          tw:mx-2 
          tw:block 
          tw:group-[.is-open]:hidden 
          tw:print:hidden!" 
        disabled
        aria-hidden="true"><svg class="icon"
    xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M328 256c0 39.8-32.2 72-72 72s-72-32.2-72-72 32.2-72 72-72 72 32.2 72 72zm104-72c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72zm-352 0c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72z"/></svg></button>
    </div>
  </div>
  <pre style="counter-reset: codeblock;" class="tw:block tw:m-0 tw:p-0"><code 
    id="codeblock-id-1" 
    class="
      chroma 
      tw:block! 
      tw:p-0
      tw:m-0
      tw:transition-[max-height] 
      tw:duration-500 
      tw:ease-in-out 
      tw:group-[.is-closed]:max-h-0! 
      tw:group-[.is-wrap]:text-wrap
      tw:overflow-y-hidden
      tw:overflow-x-auto
      tw:scrollbar-thin
      "><span class="line"><span class="cl"><span class="kd">function</span><span class="w"> </span><span class="nb">Merge-CSV</span><span class="p">{</span>
</span></span><span class="line"><span class="cl">    <span class="cm">&amp;lt;#
</span></span></span><span class="line"><span class="cl"><span class="cm">            .</span><span class="sd">SYNOPSIS</span><span class="cm">
</span></span></span><span class="line"><span class="cl"><span class="cm">                Easily merge multiple .csv files into one
</span></span></span><span class="line"><span class="cl"><span class="cm">
</span></span></span><span class="line"><span class="cl"><span class="cm">            .</span><span class="sd">DESCRIPTION</span><span class="cm">
</span></span></span><span class="line"><span class="cl"><span class="cm">                Easily merge multiple .csv files into one using splatting to a temporary Output variable
</span></span></span><span class="line"><span class="cl"><span class="cm">                and adding the content of each .csv file to this Output variable.
</span></span></span><span class="line"><span class="cl"><span class="cm">                Once each .csv file has been processed, the Output variable is written to a new .csv file.
</span></span></span><span class="line"><span class="cl"><span class="cm">
</span></span></span><span class="line"><span class="cl"><span class="cm">            .PARAMETER SourceFiles
</span></span></span><span class="line"><span class="cl"><span class="cm">                Enter paths to multiple .csv files which you would like to merge
</span></span></span><span class="line"><span class="cl"><span class="cm">
</span></span></span><span class="line"><span class="cl"><span class="cm">            .PARAMETER OutputFile
</span></span></span><span class="line"><span class="cl"><span class="cm">                Enter filename/path for the merged file
</span></span></span><span class="line"><span class="cl"><span class="cm">
</span></span></span><span class="line"><span class="cl"><span class="cm">            .</span><span class="sd">NOTES</span><span class="cm">
</span></span></span><span class="line"><span class="cl"><span class="cm">                Name: Merge-CSV.ps1
</span></span></span><span class="line"><span class="cl"><span class="cm">                author: Robert Prüst
</span></span></span><span class="line"><span class="cl"><span class="cm">                DateCreated: 12-06-2015
</span></span></span><span class="line"><span class="cl"><span class="cm">
</span></span></span><span class="line"><span class="cl"><span class="cm">            .</span><span class="sd">EXAMPLE</span><span class="cm">
</span></span></span><span class="line"><span class="cl"><span class="cm">                $Licenses = Get-ChildItem -Path c:\Licenses\Export -Filter *.csv
</span></span></span><span class="line"><span class="cl"><span class="cm">                Merge-CSV -SourceFiles $Licenses -OutputFile c:\Licenses\Overview.csv
</span></span></span><span class="line"><span class="cl"><span class="cm">    #&amp;gt;</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">    <span class="p">[</span><span class="nb">Cmdletbinding</span><span class="p">()]</span>
</span></span><span class="line"><span class="cl">    <span class="k">param</span> <span class="p">(</span>
</span></span><span class="line"><span class="cl">        <span class="p">[</span><span class="no">array</span><span class="p">]</span><span class="nv">$SourceFiles</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="p">[</span><span class="no">string</span><span class="p">]</span><span class="nv">$OutputFile</span>
</span></span><span class="line"><span class="cl">    <span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="nv">$Output</span> <span class="p">=</span> <span class="vm">@</span><span class="p">()</span>
</span></span><span class="line"><span class="cl">    <span class="k">foreach</span> <span class="p">(</span><span class="nv">$File</span> <span class="k">in</span> <span class="nv">$SourceFiles</span><span class="p">){</span>
</span></span><span class="line"><span class="cl">        <span class="nv">$TempFile</span> <span class="p">=</span> <span class="nb">Import-Csv</span> <span class="nv">$File</span><span class="p">.</span><span class="py">FullName</span>
</span></span><span class="line"><span class="cl">        <span class="nv">$Output</span> <span class="p">+=</span> <span class="nv">$TempFile</span>
</span></span><span class="line"><span class="cl">    <span class="p">}</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">    <span class="nv">$Output</span> <span class="p">|</span> <span class="nb">Export-CSV</span> <span class="nv">$OutputFile</span> <span class="n">-NoTypeInformation</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="p">}</span></span></span></code></pre>
</div>
<p>Happy scripting! 🙂</p>]]></description></item><item><title>Script Dumpster: Online-ADComputers</title><link>https://www.pr0mpt.com/2015-08-20-script-dumpster-online-adcomputers/</link><pubDate>Thu, 20 Aug 2015 15:57:17 +0200</pubDate><author><name>Robert Prüst</name><uri>https://pr0mpt.com</uri></author><guid>https://www.pr0mpt.com/2015-08-20-script-dumpster-online-adcomputers/</guid><description><![CDATA[<h1 id="the-problem" class="headerLink">
    <a href="#the-problem" class="header-mark"></a>The Problem</h1><p>Today I ran into something simple….but I just wanted to get it solved through PowerShell and make the solution re-usable.</p>
<p>We had found a machine in Active Directory which didn&rsquo;t turn up in the physical inventory check…
And worse of all, the machine was active!</p>
<h1 id="the-script" class="headerLink">
    <a href="#the-script" class="header-mark"></a>The Script</h1><p>This script simply checks if machines with a specific name [or in a specific OU] is online at the moment.
If it&rsquo;s online, it will try and figure out who&rsquo;s actually logged on to the machine.</p>]]></description></item><item><title>Script Dumpster: Find default AD containers for Users and Computers</title><link>https://www.pr0mpt.com/2015-11-05-script-dumpster-find-default-ad-containers-for-users-and-computers/</link><pubDate>Thu, 05 Nov 2015 16:04:15 +0200</pubDate><author><name>Robert Prüst</name><uri>https://pr0mpt.com</uri></author><guid>https://www.pr0mpt.com/2015-11-05-script-dumpster-find-default-ad-containers-for-users-and-computers/</guid><description><![CDATA[<h1 id="the-problem" class="headerLink">
    <a href="#the-problem" class="header-mark"></a>The Problem</h1><p>Have you ever created a new user or computer object, but you&rsquo;re unable to find them in the Default Computers/Users container?
Perhaps someone <a href="http://pc-addicts.com/server-2012-change-default-ou/" target="_blank" rel="noopener noreferrer">moved the default location</a> to another Organizational Unit [i.e. to make sure GPO&rsquo;s applied correctly] .</p>
<p>In this case a quick and simple script will check which containers are configured for this task and it will check if they&rsquo;re using default values or not.</p>
<h1 id="thescript" class="headerLink">
    <a href="#thescript" class="header-mark"></a>The Script</h1><div class="code-block highlight is-closed show-line-numbers  tw:group tw:my-2">
  <div class="
    
    tw:flex 
    tw:flex-row
    tw:flex-1 
    tw:justify-between 
    tw:w-full tw:bg-bgColor-secondary
    ">      
    <button 
      class="
        code-block-button
        tw:mx-2 
        tw:flex
        tw:flex-row
        tw:flex-1"
      aria-hidden="true">
          <span class="tw:group-[.is-open]:rotate-90 tw:transition-[transform] tw:duration-500 tw:ease-in-out tw:print:hidden! tw:w-min tw:h-min tw:my-1 tw:mx-1"><svg class="icon"
    xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"/></svg></span>
          <span class="tw:select-none tw:my-1! tw:block">powershell</span>
      </button>

   <div class="tw:flex">
      <button 
        class="
          line-number-button
          tw:mx-2 
          tw:hidden 
          tw:group-[.is-open]:block 
          tw:group-[.show-line-numbers]:text-fgColor-link 
          tw:print:hidden!" 
        title="Toggle line numbers"><svg class="icon"
    xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M61.77 401l17.5-20.15a19.92 19.92 0 0 0 5.07-14.19v-3.31C84.34 356 80.5 352 73 352H16a8 8 0 0 0-8 8v16a8 8 0 0 0 8 8h22.83a157.41 157.41 0 0 0-11 12.31l-5.61 7c-4 5.07-5.25 10.13-2.8 14.88l1.05 1.93c3 5.76 6.29 7.88 12.25 7.88h4.73c10.33 0 15.94 2.44 15.94 9.09 0 4.72-4.2 8.22-14.36 8.22a41.54 41.54 0 0 1-15.47-3.12c-6.49-3.88-11.74-3.5-15.6 3.12l-5.59 9.31c-3.72 6.13-3.19 11.72 2.63 15.94 7.71 4.69 20.38 9.44 37 9.44 34.16 0 48.5-22.75 48.5-44.12-.03-14.38-9.12-29.76-28.73-34.88zM496 224H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0-160H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16V80a16 16 0 0 0-16-16zm0 320H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zM16 160h64a8 8 0 0 0 8-8v-16a8 8 0 0 0-8-8H64V40a8 8 0 0 0-8-8H32a8 8 0 0 0-7.14 4.42l-8 16A8 8 0 0 0 24 64h8v64H16a8 8 0 0 0-8 8v16a8 8 0 0 0 8 8zm-3.91 160H80a8 8 0 0 0 8-8v-16a8 8 0 0 0-8-8H41.32c3.29-10.29 48.34-18.68 48.34-56.44 0-29.06-25-39.56-44.47-39.56-21.36 0-33.8 10-40.46 18.75-4.37 5.59-3 10.84 2.8 15.37l8.58 6.88c5.61 4.56 11 2.47 16.12-2.44a13.44 13.44 0 0 1 9.46-3.84c3.33 0 9.28 1.56 9.28 8.75C51 248.19 0 257.31 0 304.59v4C0 316 5.08 320 12.09 320z"/></svg></button>

      <button 
        class="
          wrap-code-button
          tw:select-none 
          tw:mx-2 
          tw:hidden 
          tw:group-[.is-open]:block 
          tw:group-[.is-wrap]:text-fgColor-link 
          tw:print:hidden!" 
        title="Toggle code wrap"><svg class="icon"
    xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"/></svg></button>
      
      <button 
        class="
          copy-code-button
          tw:select-none
          tw:mx-2 
          tw:hidden
          tw:group-[.is-open]:block
          tw:hover:text-fgColor-link 
          tw:print:hidden!"
        title="Copy code">
          <span class="copy-icon tw:block"><svg class="icon"
    xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M433.941 65.941l-51.882-51.882A48 48 0 0 0 348.118 0H176c-26.51 0-48 21.49-48 48v48H48c-26.51 0-48 21.49-48 48v320c0 26.51 21.49 48 48 48h224c26.51 0 48-21.49 48-48v-48h80c26.51 0 48-21.49 48-48V99.882a48 48 0 0 0-14.059-33.941zM266 464H54a6 6 0 0 1-6-6V150a6 6 0 0 1 6-6h74v224c0 26.51 21.49 48 48 48h96v42a6 6 0 0 1-6 6zm128-96H182a6 6 0 0 1-6-6V54a6 6 0 0 1 6-6h106v88c0 13.255 10.745 24 24 24h88v202a6 6 0 0 1-6 6zm6-256h-64V48h9.632c1.591 0 3.117.632 4.243 1.757l48.368 48.368a6 6 0 0 1 1.757 4.243V112z"/></svg></span>
          <span class="check-icon tw:hidden"><svg class="icon"
    xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"/></svg></span>
      </button>
        
      <button 
        class="
          tw:select-none 
          tw:mx-2 
          tw:block 
          tw:group-[.is-open]:hidden 
          tw:print:hidden!" 
        disabled
        aria-hidden="true"><svg class="icon"
    xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M328 256c0 39.8-32.2 72-72 72s-72-32.2-72-72 32.2-72 72-72 72 32.2 72 72zm104-72c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72zm-352 0c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72z"/></svg></button>
    </div>
  </div>
  <pre style="counter-reset: codeblock;" class="tw:block tw:m-0 tw:p-0"><code 
    id="codeblock-id-1" 
    class="
      chroma 
      tw:block! 
      tw:p-0
      tw:m-0
      tw:transition-[max-height] 
      tw:duration-500 
      tw:ease-in-out 
      tw:group-[.is-closed]:max-h-0! 
      tw:group-[.is-wrap]:text-wrap
      tw:overflow-y-hidden
      tw:overflow-x-auto
      tw:scrollbar-thin
      "><span class="line"><span class="cl"><span class="cm">&amp;lt;#
</span></span></span><span class="line"><span class="cl"><span class="cm">	.</span><span class="sd">NOTES</span><span class="cm">
</span></span></span><span class="line"><span class="cl"><span class="cm">	===========================================================================
</span></span></span><span class="line"><span class="cl"><span class="cm">	 Created with: 	SAPIEN Technologies, Inc., PowerShell Studio 2015 v4.2.95
</span></span></span><span class="line"><span class="cl"><span class="cm">	 Created on:   	11/3/2015 13:22
</span></span></span><span class="line"><span class="cl"><span class="cm">	 Created by:   	Robert Prüst
</span></span></span><span class="line"><span class="cl"><span class="cm">	 Organization: 	powershellpr0mpt.com
</span></span></span><span class="line"><span class="cl"><span class="cm">	 Filename:      Find-DefaultUserComputerContainer.ps1
</span></span></span><span class="line"><span class="cl"><span class="cm">	===========================================================================
</span></span></span><span class="line"><span class="cl"><span class="cm">	.</span><span class="sd">DESCRIPTION</span><span class="cm">
</span></span></span><span class="line"><span class="cl"><span class="cm">		A description of the file.
</span></span></span><span class="line"><span class="cl"><span class="cm">#&amp;gt;</span>
</span></span><span class="line"><span class="cl"><span class="nb">Import-Module</span> <span class="n">ActiveDirectory</span> <span class="n">-ErrorAction</span> <span class="n">SilentlyContinue</span>
</span></span><span class="line"><span class="cl"><span class="p">[</span><span class="no">array</span><span class="p">]</span><span class="nv">$locations</span> <span class="p">=</span> <span class="nb">Get-ADObject</span> <span class="n">-Filter</span> <span class="p">{</span> <span class="n">isCriticalSystemObject</span> <span class="o">-eq</span> <span class="vm">$true</span> <span class="p">}</span> <span class="p">|</span> <span class="nb">Where </span><span class="p">{</span> <span class="p">(</span><span class="nv">$_</span><span class="p">.</span><span class="py">objectclass</span> <span class="o">-eq</span> <span class="s1">&#39;container&#39;</span> <span class="o">-or</span> <span class="nv">$_</span><span class="p">.</span><span class="py">objectclass</span> <span class="o">-eq</span> <span class="s1">&#39;organizationalUnit&#39;</span><span class="p">)</span> <span class="o">-and</span> <span class="p">(</span><span class="o">-not</span> <span class="p">(</span><span class="nv">$_</span><span class="p">.</span><span class="py">DistinguishedName</span> <span class="o">-like</span> <span class="s1">&#39;*ForeignSecurityPrincipals,DC*&#39;</span><span class="p">))</span> <span class="o">-and</span> <span class="p">(</span><span class="o">-not</span> <span class="p">(</span><span class="nv">$_</span><span class="p">.</span><span class="py">DistinguishedName</span> <span class="o">-like</span> <span class="s1">&#39;*CN=System,DC*&#39;</span><span class="p">))</span> <span class="o">-and</span> <span class="p">(</span><span class="o">-not</span> <span class="p">(</span><span class="nv">$_</span><span class="p">.</span><span class="py">DistinguishedName</span> <span class="o">-like</span> <span class="s1">&#39;*Domain Controllers,DC*&#39;</span><span class="p">))</span> <span class="o">-and</span> <span class="p">(</span><span class="o">-not</span> <span class="p">(</span><span class="nv">$_</span><span class="p">.</span><span class="py">DistinguishedName</span> <span class="o">-like</span> <span class="s1">&#39;*ForeignSecurityPrincipals*&#39;</span><span class="p">))</span> <span class="p">}</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="k">foreach</span> <span class="p">(</span><span class="nv">$location</span> <span class="k">in</span> <span class="nv">$locations</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="p">{</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">	<span class="nv">$DistinguishedName</span> <span class="p">=</span> <span class="nv">$location</span><span class="p">.</span><span class="py">DistinguishedName</span>
</span></span><span class="line"><span class="cl">	<span class="k">if</span> <span class="p">(</span><span class="nv">$location</span><span class="p">.</span><span class="py">ObjectClass</span> <span class="o">-eq</span> <span class="s1">&#39;OrganizationalUnit&#39;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">	<span class="p">{</span>
</span></span><span class="line"><span class="cl">		<span class="nv">$DefaultFolder</span> <span class="p">=</span> <span class="vm">$false</span>
</span></span><span class="line"><span class="cl">	<span class="p">}</span>
</span></span><span class="line"><span class="cl">	<span class="k">else</span>
</span></span><span class="line"><span class="cl">	<span class="p">{</span>
</span></span><span class="line"><span class="cl">		<span class="nv">$DefaultFolder</span> <span class="p">=</span> <span class="vm">$true</span>
</span></span><span class="line"><span class="cl">	<span class="p">}</span>
</span></span><span class="line"><span class="cl">	<span class="nv">$properties</span> <span class="p">=</span> <span class="vm">@</span><span class="p">{</span>
</span></span><span class="line"><span class="cl">		<span class="s1">&#39;Location&#39;</span> <span class="p">=</span> <span class="nv">$DistinguishedName</span><span class="p">;</span>
</span></span><span class="line"><span class="cl">		<span class="s1">&#39;DefaultFolder&#39;</span> <span class="p">=</span> <span class="nv">$DefaultFolder</span><span class="p">;</span>
</span></span><span class="line"><span class="cl">	<span class="p">}</span>
</span></span><span class="line"><span class="cl">	<span class="nv">$obj</span> <span class="p">=</span> <span class="nb">New-Object</span> <span class="n">-TypeName</span> <span class="n">PSObject</span> <span class="n">-Property</span> <span class="nv">$properties</span>
</span></span><span class="line"><span class="cl">	<span class="nv">$obj</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span></span></span></code></pre>
</div>]]></description></item><item><title>Script Dumpster: Find services running under non-standard accounts</title><link>https://www.pr0mpt.com/2015-11-06-script-dumpster-find-services-running-under-non-standard-accounts/</link><pubDate>Fri, 06 Nov 2015 14:00:42 +0200</pubDate><author><name>Robert Prüst</name><uri>https://pr0mpt.com</uri></author><guid>https://www.pr0mpt.com/2015-11-06-script-dumpster-find-services-running-under-non-standard-accounts/</guid><description><![CDATA[<h1 id="the-problem" class="headerLink">
    <a href="#the-problem" class="header-mark"></a>The Problem</h1><p>Looking for services which are running under NON-standard accounts?
Just use this script to display these services.</p>
<p>Very handy in case you need to change passwords for service accounts or want to see what services might be improperly configured [e.g. running under Administrator credentials, or worse, Domain Administrator credentials]</p>
<h1 id="the-script" class="headerLink">
    <a href="#the-script" class="header-mark"></a>The Script</h1><div class="code-block highlight is-closed show-line-numbers  tw:group tw:my-2">
  <div class="
    
    tw:flex 
    tw:flex-row
    tw:flex-1 
    tw:justify-between 
    tw:w-full tw:bg-bgColor-secondary
    ">      
    <button 
      class="
        code-block-button
        tw:mx-2 
        tw:flex
        tw:flex-row
        tw:flex-1"
      aria-hidden="true">
          <span class="tw:group-[.is-open]:rotate-90 tw:transition-[transform] tw:duration-500 tw:ease-in-out tw:print:hidden! tw:w-min tw:h-min tw:my-1 tw:mx-1"><svg class="icon"
    xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"/></svg></span>
          <span class="tw:select-none tw:my-1! tw:block">powershell</span>
      </button>

   <div class="tw:flex">
      <button 
        class="
          line-number-button
          tw:mx-2 
          tw:hidden 
          tw:group-[.is-open]:block 
          tw:group-[.show-line-numbers]:text-fgColor-link 
          tw:print:hidden!" 
        title="Toggle line numbers"><svg class="icon"
    xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M61.77 401l17.5-20.15a19.92 19.92 0 0 0 5.07-14.19v-3.31C84.34 356 80.5 352 73 352H16a8 8 0 0 0-8 8v16a8 8 0 0 0 8 8h22.83a157.41 157.41 0 0 0-11 12.31l-5.61 7c-4 5.07-5.25 10.13-2.8 14.88l1.05 1.93c3 5.76 6.29 7.88 12.25 7.88h4.73c10.33 0 15.94 2.44 15.94 9.09 0 4.72-4.2 8.22-14.36 8.22a41.54 41.54 0 0 1-15.47-3.12c-6.49-3.88-11.74-3.5-15.6 3.12l-5.59 9.31c-3.72 6.13-3.19 11.72 2.63 15.94 7.71 4.69 20.38 9.44 37 9.44 34.16 0 48.5-22.75 48.5-44.12-.03-14.38-9.12-29.76-28.73-34.88zM496 224H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0-160H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16V80a16 16 0 0 0-16-16zm0 320H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zM16 160h64a8 8 0 0 0 8-8v-16a8 8 0 0 0-8-8H64V40a8 8 0 0 0-8-8H32a8 8 0 0 0-7.14 4.42l-8 16A8 8 0 0 0 24 64h8v64H16a8 8 0 0 0-8 8v16a8 8 0 0 0 8 8zm-3.91 160H80a8 8 0 0 0 8-8v-16a8 8 0 0 0-8-8H41.32c3.29-10.29 48.34-18.68 48.34-56.44 0-29.06-25-39.56-44.47-39.56-21.36 0-33.8 10-40.46 18.75-4.37 5.59-3 10.84 2.8 15.37l8.58 6.88c5.61 4.56 11 2.47 16.12-2.44a13.44 13.44 0 0 1 9.46-3.84c3.33 0 9.28 1.56 9.28 8.75C51 248.19 0 257.31 0 304.59v4C0 316 5.08 320 12.09 320z"/></svg></button>

      <button 
        class="
          wrap-code-button
          tw:select-none 
          tw:mx-2 
          tw:hidden 
          tw:group-[.is-open]:block 
          tw:group-[.is-wrap]:text-fgColor-link 
          tw:print:hidden!" 
        title="Toggle code wrap"><svg class="icon"
    xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"/></svg></button>
      
      <button 
        class="
          copy-code-button
          tw:select-none
          tw:mx-2 
          tw:hidden
          tw:group-[.is-open]:block
          tw:hover:text-fgColor-link 
          tw:print:hidden!"
        title="Copy code">
          <span class="copy-icon tw:block"><svg class="icon"
    xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M433.941 65.941l-51.882-51.882A48 48 0 0 0 348.118 0H176c-26.51 0-48 21.49-48 48v48H48c-26.51 0-48 21.49-48 48v320c0 26.51 21.49 48 48 48h224c26.51 0 48-21.49 48-48v-48h80c26.51 0 48-21.49 48-48V99.882a48 48 0 0 0-14.059-33.941zM266 464H54a6 6 0 0 1-6-6V150a6 6 0 0 1 6-6h74v224c0 26.51 21.49 48 48 48h96v42a6 6 0 0 1-6 6zm128-96H182a6 6 0 0 1-6-6V54a6 6 0 0 1 6-6h106v88c0 13.255 10.745 24 24 24h88v202a6 6 0 0 1-6 6zm6-256h-64V48h9.632c1.591 0 3.117.632 4.243 1.757l48.368 48.368a6 6 0 0 1 1.757 4.243V112z"/></svg></span>
          <span class="check-icon tw:hidden"><svg class="icon"
    xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"/></svg></span>
      </button>
        
      <button 
        class="
          tw:select-none 
          tw:mx-2 
          tw:block 
          tw:group-[.is-open]:hidden 
          tw:print:hidden!" 
        disabled
        aria-hidden="true"><svg class="icon"
    xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M328 256c0 39.8-32.2 72-72 72s-72-32.2-72-72 32.2-72 72-72 72 32.2 72 72zm104-72c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72zm-352 0c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72z"/></svg></button>
    </div>
  </div>
  <pre style="counter-reset: codeblock;" class="tw:block tw:m-0 tw:p-0"><code 
    id="codeblock-id-1" 
    class="
      chroma 
      tw:block! 
      tw:p-0
      tw:m-0
      tw:transition-[max-height] 
      tw:duration-500 
      tw:ease-in-out 
      tw:group-[.is-closed]:max-h-0! 
      tw:group-[.is-wrap]:text-wrap
      tw:overflow-y-hidden
      tw:overflow-x-auto
      tw:scrollbar-thin
      "><span class="line"><span class="cl"><span class="cm">&amp;lt;#
</span></span></span><span class="line"><span class="cl"><span class="cm">	.</span><span class="sd">NOTES</span><span class="cm">
</span></span></span><span class="line"><span class="cl"><span class="cm">	===========================================================================
</span></span></span><span class="line"><span class="cl"><span class="cm">	 Created with: 	SAPIEN Technologies, Inc., PowerShell Studio 2015 v4.2.95
</span></span></span><span class="line"><span class="cl"><span class="cm">	 Created on:   	11/3/2015 09:53
</span></span></span><span class="line"><span class="cl"><span class="cm">	 Created by:   	Robert Prüst
</span></span></span><span class="line"><span class="cl"><span class="cm">	 Organization: 	powershellpr0mpt.com
</span></span></span><span class="line"><span class="cl"><span class="cm">	 Filename:     	Get-CustomService.ps1
</span></span></span><span class="line"><span class="cl"><span class="cm">	===========================================================================
</span></span></span><span class="line"><span class="cl"><span class="cm">#&amp;gt;</span>
</span></span><span class="line"><span class="cl"><span class="cm">&amp;lt;#
</span></span></span><span class="line"><span class="cl"><span class="cm">	.</span><span class="sd">SYNOPSIS</span><span class="cm">
</span></span></span><span class="line"><span class="cl"><span class="cm">		Find services which are running under non-standard accounts
</span></span></span><span class="line"><span class="cl"><span class="cm">
</span></span></span><span class="line"><span class="cl"><span class="cm">	.</span><span class="sd">DESCRIPTION</span><span class="cm">
</span></span></span><span class="line"><span class="cl"><span class="cm">		Find services through WMI which are running under non-standard accounts, so you know which services to check/change in case of password changes.
</span></span></span><span class="line"><span class="cl"><span class="cm">		Non-standard accounts include anything starting with &#39;NT AUTHORITY\&#39; or LocalSystem.
</span></span></span><span class="line"><span class="cl"><span class="cm">
</span></span></span><span class="line"><span class="cl"><span class="cm">	.PARAMETER ComputerName
</span></span></span><span class="line"><span class="cl"><span class="cm">		Enter the computername you&#39;d like to query. Default value is &#39;localhost&#39;
</span></span></span><span class="line"><span class="cl"><span class="cm">
</span></span></span><span class="line"><span class="cl"><span class="cm">	.</span><span class="sd">EXAMPLE</span><span class="cm">
</span></span></span><span class="line"><span class="cl"><span class="cm">				PS C:\&amp;gt; Get-CustomServices -ComputerName &#39;CONTOSO-SRV001&#39;
</span></span></span><span class="line"><span class="cl"><span class="cm">				Queries CONTOSO-SRV001 for any services running on non-standard accounts
</span></span></span><span class="line"><span class="cl"><span class="cm">
</span></span></span><span class="line"><span class="cl"><span class="cm">	.</span><span class="sd">NOTES</span><span class="cm">
</span></span></span><span class="line"><span class="cl"><span class="cm">		Script created to aid with change of domain admin account passwords.
</span></span></span><span class="line"><span class="cl"><span class="cm">#&amp;gt;</span>
</span></span><span class="line"><span class="cl"><span class="kd">function</span><span class="w"> </span><span class="nb">Get-CustomService</span>
</span></span><span class="line"><span class="cl"><span class="p">{</span>
</span></span><span class="line"><span class="cl">	<span class="p">[</span><span class="nb">CmdletBinding</span><span class="p">()]</span>
</span></span><span class="line"><span class="cl">	<span class="k">param</span>
</span></span><span class="line"><span class="cl">	<span class="p">(</span>
</span></span><span class="line"><span class="cl">		<span class="p">[</span><span class="no">string</span><span class="p">]</span><span class="nv">$ComputerName</span> <span class="p">=</span> <span class="s1">&#39;localhost&#39;</span>
</span></span><span class="line"><span class="cl">	<span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">	<span class="nb">Get-WmiObject</span> <span class="n">-Class</span> <span class="n">Win32_Service</span> <span class="n">-ComputerName</span> <span class="nv">$ComputerName</span> <span class="p">|</span> <span class="nb">Where-Object</span> <span class="p">{</span> <span class="nv">$_</span><span class="p">.</span><span class="py">StartName</span> <span class="o">-notlike</span> <span class="s1">&#39;NT AUTHORITY\*&#39;</span> <span class="o">-and</span> <span class="nv">$_</span><span class="p">.</span><span class="py">StartName</span> <span class="o">-ne</span> <span class="s1">&#39;LocalSystem&#39;</span> <span class="p">}</span> <span class="p">|</span> <span class="nb">Select-Object</span> <span class="n">SystemName</span><span class="p">,</span> <span class="n">Name</span><span class="p">,</span> <span class="n">State</span><span class="p">,</span> <span class="n">StartName</span><span class="p">,</span> <span class="n">StartMode</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span></span></span></code></pre>
</div>]]></description></item><item><title>Script Dumpster: Clean-RedirectedRecycleBin</title><link>https://www.pr0mpt.com/2015-11-07-script-dumpster-clean-redirectedrecyclebin/</link><pubDate>Sat, 07 Nov 2015 14:00:06 +0200</pubDate><author><name>Robert Prüst</name><uri>https://pr0mpt.com</uri></author><guid>https://www.pr0mpt.com/2015-11-07-script-dumpster-clean-redirectedrecyclebin/</guid><description><![CDATA[<h1 id="the-problem" class="headerLink">
    <a href="#the-problem" class="header-mark"></a>The problem</h1><p>Redirected Folders on RDS Session hosts tend to cause a specific issue:</p>
<p>Each user&rsquo;s set of Redirected Folders creates their own Recycle Bin entry, which can grow quite a bit.
The following function can display a list of files contained within the Recycle Bins older than the provided age.</p>
<p>Even better, the script has a switch parameter <strong>Remove</strong> which does exactly what you think it does 🙂</p>
<p>Through a scheduled task you can run this script on a regular basis when required.</p>]]></description></item><item><title>Script Dumpster: Reporting all files on ESX Datastores</title><link>https://www.pr0mpt.com/2016-02-02-script-dumpster-reporting-all-files-on-esx-datastores/</link><pubDate>Tue, 02 Feb 2016 12:53:05 +0200</pubDate><author><name>Robert Prüst</name><uri>https://pr0mpt.com</uri></author><guid>https://www.pr0mpt.com/2016-02-02-script-dumpster-reporting-all-files-on-esx-datastores/</guid><description><![CDATA[<h1 id="the-problem" class="headerLink">
    <a href="#the-problem" class="header-mark"></a>The Problem</h1><p>I had a customer who was complaining that the simple overview of disks used by VM&rsquo;s didn&rsquo;t add up to the amount of data in use on datastores.
Simple reasoning being swap files, snapshots etc. etc. , but the customer wanted to see exactly what was causing this…</p>
<p>In comes <a href="https://www.vmware.com/support/developer/PowerCLI/" target="_blank">PowerCLI </a>[VMWare&rsquo;s adaption of PowerShell for their solutions]</p>
<h1 id="the-script" class="headerLink">
    <a href="#the-script" class="header-mark"></a>The Script</h1><p>Edit: As I had thought at first instance, the datacenter name was working just fine on my 2 test environments, but in a 3rd I quickly ran into an error.</p>]]></description></item><item><title>Script Dumpster: Keep last X amount of files or Y amount of days</title><link>https://www.pr0mpt.com/2016-02-17-script-dumpster-keep-last-x-amount-of-files-or-y-amount-of-days/</link><pubDate>Wed, 17 Feb 2016 13:56:12 +0200</pubDate><author><name>Robert Prüst</name><uri>https://pr0mpt.com</uri></author><guid>https://www.pr0mpt.com/2016-02-17-script-dumpster-keep-last-x-amount-of-files-or-y-amount-of-days/</guid><description><![CDATA[<p>Ever had the need to remove all but the last X amount of copies of a back-up?</p>
<p>And I&rsquo;m not talking about the copies from the last 2 days, because this can cause issues if the files aren&rsquo;t created daily [in case of a weekend], in case a back-up has failed in the meantime or if multiple back-up copies have been made in one day.</p>
<p>While at first I was always playing around with the simple solution by checking file age, I ran into a more elegant solution I&rsquo;d like to share with you.</p>]]></description></item><item><title>Script Dumpster: List all email addresses and Mailbox Size - OnPrem &amp; O365</title><link>https://www.pr0mpt.com/2016-05-12-script-dumpster-list-all-email-addresses-and-mailbox-size-onprem-o365/</link><pubDate>Thu, 12 May 2016 10:58:43 +0200</pubDate><author><name>Robert Prüst</name><uri>https://pr0mpt.com</uri></author><guid>https://www.pr0mpt.com/2016-05-12-script-dumpster-list-all-email-addresses-and-mailbox-size-onprem-o365/</guid><description><![CDATA[<h2 id="update" class="headerLink">
    <a href="#update" class="header-mark"></a>Update</h2><p>I&rsquo;ve optimized the script to now only query each mailbox once and have increased the speed in this customer&rsquo;s environment for On-premise from 1 minute 49 seconds to 26 seconds.
The Office 365 code was optimized similarly and went down from 22 minutes 14 seconds to 7 minutes 21 seconds.</p>
<p>The output of the optimized script is identical to the original one.</p>
<h1 id="intro" class="headerLink">
    <a href="#intro" class="header-mark"></a>Intro</h1><p>As the title suggest, I had a customer asking for a list of all email addresses within the company and the accompanying mailbox sizes.</p>]]></description></item></channel></rss>