Advertisement
Guest User

Untitled

a guest
May 15th, 2017
385
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $monitoredExtensions = ((Invoke-WebRequest -Uri "https://fsrm.experiant.ca/api/v1/get" -UseBasicParsing).content | convertfrom-json | % {$_.filters})
  2.  
  3. If (Test-Path .\SkipList.txt) {
  4.     $Exclusions = Get-Content .\SkipList.txt
  5.     ForEach ($Exclusion in $Exclusions) {
  6.         if ($Exclusion) {
  7.             $monitoredExtensions = $monitoredExtensions.replace($Exclusion.trim(),$null)
  8.         }
  9.     }
  10. }
  11.  
  12. $Servers = Get-ADcomputer -Filter * -SearchBase "<OU TO YOUR SERVERS HERE>"| Select-Object -ExpandProperty name | Sort
  13.  
  14. $Current = Get-FsrmFileGroup -Name "<YOUR CRYPTO FILE GROUP HERE>" | Select-Object -ExpandProperty includepattern
  15.  
  16. $New = $Current + $monitoredExtensions | sort -Unique
  17.  
  18. Invoke-Command -ComputerName $Servers -ArgumentList $New -ScriptBlock {Set-FSRMFileGroup -Name "<YOUR CRYPTO FILE GROUP HERE>" -Includepattern $args}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement