Jump to content


  • Posts

  • Joined

  • Last visited

  • Donations

  • Country


About Albiz

Profile Information

  • OS
    Server 2008R2

Albiz's Achievements



  1. i've got some folder, like 00-Doc, starting with numbers; Those folders MUST NOT BE DELETED. I think this if(Folder start with(list)){skip}$Dir="C:\Test" $Et1="0"$Et2="9"foreach( $In in(Get-ChildItem $Dir -Recurse)){ #per ogni cartella in $Dirif(!(Get-ChildItem -Path $In.FullName)){ #se non hai figli$Sav=Split-Path( $In ) -leaf; #prendi il nome della cartellaif(!($Sav.StartsWith($Et1)) -and (!($Sav.StartsWith($Et2)))){ #se non fa parte delle eccezioniecho $In.FullName; #stampa#Remove-Item $In.FullName}}}maybe
  2. Hi guys! Today i'm working on a VM with Windows server 2008 R2, the role is File services, file server and file server resource manager are installed. I want to do those things, scheduled if possible: Delete empty foldersCreate a report for duplicate filesDelete temprary filesFor the first problem i've created a script: $Dir="C:\Test" foreach( $In in(Get-ChildItem $Dir -Recurse)){if(!(Get-ChildItem -Path $In.FullName)){echo $In.FullName;Remove-Item $In.FullName}}for the last problem i used File management tasks creating a role for each extension. what about the second problem? Nothing i've done... suggestions? Thanks A

  • Create New...