get-aduser not working in PS for Web Access

Welcome Forums General PowerShell Q&A get-aduser not working in PS for Web Access

This topic contains 1 reply, has 2 voices, and was last updated by

 
Keymaster
4 years, 10 months ago.

  • Author
    Posts
  • #13553

    Participant
    Points: 31
    Rank: Member

    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

    Keymaster
    Points: 1,759
    Helping HandTeam Member
    Rank: Community Hero

    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.

The topic ‘get-aduser not working in PS for Web Access’ is closed to new replies.