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....
Can someone help please? Thanks!
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.