get-aduser not working in PS for Web Access

This topic contains 1 reply, has 2 voices, and was last updated by Profile photo of Don Jones Don Jones 3 years, 1 month ago.

  • Author
    Posts
  • #13553
    Profile photo of bvi1998 .
    bvi1998 .
    Participant

    Hi,

    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....
    script:
    $user = Get-ADUser "$user" -Properties mail

    Error:
    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!

  • #13556
    Profile photo of Don Jones
    Don Jones
    Keymaster

    It's likely a multi-hop auth issue. When using PWA, you point your web browser at machine A, the PWA box. You give it credentials, which it impersonates. You also specify a machine to connect to (Machine B), and PWA uses Remoting to connect to that machine.

    The AD cmdlets, in turn, need to talk to a web service on the DC, machine C. it's possible your credential isn't going that far – even if all 3 machines are actually one computer.

    It may also not be authentication. It may be that whatever machine PWA is connecting to isn't able to resolve the domain controller. That seems more likely given the error.

You must be logged in to reply to this topic.