title: How to search inside folder using PowerShell + GPO?
body: <p>First I wrote this PowerShell to get any file that ends with specific file extension in <code>c:\Users\Public</code> path:</p>
  <pre><code>$Include = &quot;*.doc&quot;,&quot;*.docm&quot;,&quot;*.docx&quot;,&quot;*.dot&quot;,&quot;*.dotm&quot;,&quot;*.dotx&quot;,&quot;*.htm&quot;,&quot;*.html&quot;,&quot;*.odt&quot;,&quot;*.pdf&quot;,&quot;*.txt&quot;,&quot;*.xml&quot;,&quot;*.csv&quot;,&quot;*.xla&quot;,&quot;*.xlam&quot;,&quot;*.xls&quot;,&quot;*.xlsb&quot;,&quot;*.xlsm&quot;,&quot;*.xlsx&quot;,&quot;*.xlt&quot;,&quot;*.xltx&quot;,&quot;*.xlw&quot;,&quot;*.gif&quot;,&quot;*.jpg&quot;,&quot;*.png&quot;,&quot;*.pot&quot;,&quot;*.potm&quot;,&quot;*.potx&quot;,&quot;*.ppa&quot;,&quot;*.ppam&quot;,&quot;*.pps&quot;,&quot;*.ppsm&quot;,&quot;*.ppsx&quot;,&quot;*.ppt&quot;,&quot;*.ppt&quot;
  get-childitem &quot;C:\Users\Public\Desktop&quot;,&quot;C:\Users\Public\AccountPictures&quot;,&quot;C:\Users\Public\Documents&quot;,&quot;C:\Users\Public\Downloads&quot;,&quot;C:\Users\Public\Libraries&quot;,&quot;C:\Users\Public\Music&quot;,&quot;C:\Users\Public\Pictures&quot;,&quot;C:\Users\Public\Videos&quot; -Include $Include -Recurse
  </code></pre>
  <p>It worked great but as you can see I could not use <code>Get-Childitem &quot;C:\Users\Public\*&quot;</code> this did not work and I was wondering if the user has folder with different name for example &quot;C:\Users\Public\example1&quot; I want to search inside it for sure but I don't know the name of the folder.</p>
  <p>Second how can I run the PowerShell script with GPO to search the file extension in the <code>C:\Users\Public\*</code> on specific <strong>IP</strong> or <strong>username</strong> or <strong>hostname</strong> inside the company.</p>