Powershell - Invoke command access denied while not running under domain admin account

Viewed 14931

I'm using a script to create a folder on a remote server which is a filew server and a RODC. When I run the script from a domain admin user the command complet successfuly. When I run with an account that is on the group that can administer the RODC I got an access denied.

$remotefolder = [scriptblock]::create("New-Item -Path d:\testfolder -type directory -Force ")
Invoke-Command -ComputerName server1 -ScriptBlock $remotefolder

I get this error:

[server1] Connecting to remote server server1 failed with the following error message : Access is denied. 
For more information, see the about_Remote_Troubleshooting Help topic.
    + CategoryInfo          : OpenError: (server1:String) [], PSRemotingTransportException
    + FullyQualifiedErrorId : AccessDenied,PSSessionStateBroken

As it's an RODC there's no local groups that I can add my users that need to run this script.

Is anybody know how I can stop getting this accessdenied ?

Update 12/12: I tried the same script block on a domain member server only and I don't get the access denied message, the folder is created as it should. Any toughs on how I can get this script block running on a RODC without using a Domain admin user ?

1 Answers
Related