I have having a difficult time with this script. I created a user termination script to automate removing users from our system. The issue I am having is, we have two servers where our users home folders live, one at the main building and one across town. Now when I run the script using the local server, it moves the folder fine, but if I put the remote server in, it exits without prompt.
Powershell
#################UserName#####################Import-ModuleActiveDirectory$FirstName=Read-Host-Prompt"please enter First Name"$LastName=Read-Host-Prompt"please enter Last Name"$Username=(Get-ADUser-Filter"GivenName -like '$FirstName*' -and Surname -like '$LastName*'").SamAccountNameif($Username-eq$null){Write-output"User Does not exist."Exit}Else{Write-Output$Username}################################################...