Tag: Get-Childitem
List Scheduled Tasks for Remote Servers
- Ben Liebowitz
- 0
- 7005
Recently, I was asked to find out of a certain service account was being used in scheduled tasks on any server. Being a PowerShell guy, I turned to the Get-ScheduledTask cmdlet. I tried querying a list of scheduled tasks by Author. I created a variable $VMs and used it to filter any Powered on Windows VM. I then checked each…
Share This:
Script to delete folder older than 30 days… by Name
- Ben Liebowitz
- 0
- 3584
I had a need, on one of my file servers, to delete some data that was older than 30 days, to clear space. This would need to be a re-occurring task, so what better way to accomplish it than to script it! Here’s the rub… The folders are each in a YYYYMMDD format (ex: 20170115), yet the content in the…
Share This: