This code works perfectly in Powershell ISE on the same server, but when running the same script in PS for Web Access I get an error…
$user = Get-ADUser “$user” -Properties mail
Unable to contact the server. This may be because this server does not exist, it is currently down, or it does not have the Active Directory Web Services running.
Can someone help please? Thanks!