Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Authorization Question

$
0
0

Hi all,

 

i'm really new to powershell and to this forum, so hello to everybody.

I have a  problem which i can' solve, but it sound really simple to me.

In my environment i have a central jumphost. From there is start my PS scripts on the other remote servers.
jumphost: Windows 2012R2
remote servers: Windows 2008R2 with PS v2.0

In these scripts i have an output to a logfile that is located on the jumphost. The hosts are connecting due UNC to the jumphost logfile location.

With this script i just want to test if i can access the logfile location from the remote host:

Invoke-Command -ComputerName $remoteserver -Credential $credentials -ScriptBlock {new-item -ItemType directory \\server\path\to\logs -force}

 

But i got the following error:

Access to the path 'logs' is denied.
    + CategoryInfo          : PermissionDenied: (\\server\path\to\logs:String) [New-Item], UnauthorizedAccessException
    + FullyQualifiedErrorId : CreateDirectoryUnauthorizedAccessError,Microsoft.PowerShell.Commands.NewItemCommand

 

If i run the command "new-item -ItemType directory \\server\path\to\logs -force" on the remote server with the same user, everything is fine

 

May you have any ideas to help me?

 

Regards

 

Oliver


Viewing all articles
Browse latest Browse all 6937

Trending Articles