Hello, I have the following problem.
In my script I have the following line:
$userfolder = "\\$NewServer\Users$\$($ADUser.sAMAccountname)"
My problem here is that I can't make two variables at that. So for an example if I write only one:
$userfolder = "\\AD2019\Users$\$($ADUser.sAMAccountname)"
It works perfect. I saw that Join-Path could help, but at the middle I have "Users$" what is not a variable.
How can I do a Join-Path with that construction?