Get-ACL with Invoke-Command

45 Views Asked by At

i have a problem with a PowerShell Command.

When i try this command:

Invoke-Command -ComputerName ... -Credential $cred -ScriptBlock {Get-Acl -Path "..."}

i get an access denied message.

When i try to execute the command on the local machine without Invoke-Command it works. I use the same Credentials for Invoke Command and to execute it on the local machine.

The Executionpolicy on the remote server is on: RemoteSigned

Commands like New-ADuser and so on works fine.

Does someone know how can i fix this?

0

There are 0 best solutions below