Below Powershell script will move all files from source to destination. Can be used as archival job. Just copy paste below script and edit yellow highlighted text as per your environment and get it working. $Date=(Get-Date).AddDays(-90).Date$Source = “D:\Test*.*“$Destination = “\share_location\TestFolder$“Foreach($file in (Get-ChildItem $Source)){If($file.LastWriteTime -lt $Date){Move-Item -Path $file.fullname -Destination $Destination}}Send-MailMessage -From From_address -To To_address -Subject “ArchiveContinue reading “Move Files using Powershell”
Tag Archives: housekeeping
Delete Inactive FSLogix Profiles
Below Powershell script will delete all Inactive FSLogix profiles configured and send email of profiles deleted and space saved. Just copy paste below script and edit yellow highlighted text as per your environment and get it working. $Date=(Get-Date).AddDays(-90)$FormatDate = Get-Date -Format dd-MM-yyyy$vhds=Get-ChildItem –Path “mention_profile_location” -Recurse | Where-Object {$_.Name -like “*.vhd”} | where-object {($_.LastWriteTime -lt $Date)}Continue reading “Delete Inactive FSLogix Profiles”