How do you copy files and folders from shared drive to SharePoint document library using PowerShell? If files or folders are deleted from file share it should remove from SharePoint library as well. But if files or folders are deleted from SharePoint, then it should put it back if file share has it. I basically want to sync from file share to SharePoint maintaining folder and file structure with metadata. Thanks for all the help!
wow!!! this is quite dificult, not because the script, it's dificult because you have a lot of job:
1) You need to enable auditing of files and folders, a good URL: https://www.lepide.com/how-to/track-file-deletions-and-permission-changes-on-file-servers.html
2) add a trigger to the event on the events viewer, URL: https://blogs.technet.microsoft.com/wincat/2011/08/25/trigger-a-powershell-script-from-a-windows-event/
Now you can think about the PowerShell, let me code a little to give you a help with that.