I’m writing a script to copy users off our old (VERY OLD) file server to a new one that will have their my documents folder created by GPO. The problem is, the old server is 14 years old and the users my docs folder have different names depending on who was doing it. “My Docs”, “Documents”, “My Documents”, “User Docs”, “docs” and so on. I’m trying to have this script scan through the list, once it gets the users username (that part I have working). So I’m not sure if I would need something like $source1 = “serverusers$nameMy Docs*”. Followed by $source2, $source3 and so on for each possible location, and then an if (!(Test-Path – Path $source1))? And what would I need to do to get it to look for the others, and once it finds one copy that location?
submitted by /u/admlshake
[link] [comments]
The post Looking for multiple possible folder paths to copy to new destination. appeared first on How to Code .NET.