Dificult in Create Script

This topic contains 1 reply, has 2 voices, and was last updated by Profile photo of random commandline random commandline 6 months ago.

  • Author
    Posts
  • #62527
    Profile photo of Fabio
    Fabio
    Participant

    Good morning.

    I need a script where today I have a server 2012 that works as a file server, on this server I have a Public folder, where I need to move everything as folders with modification greater than 60 days to a certain mass on an external server that also this server.

    can you help me?

    Grateful

  • #62554
    Profile photo of random commandline
    random commandline
    Participant
    Get-ChildItem \\source\folder\ -Recurse | 
    Where-Object {$_.LastWriteTime -gt (Get-Date).AddDays(-60)} |
    Move-Item -Destination \\destination\folder\
    

You must be logged in to reply to this topic.