add module from share drive using credentials

Can I add a module from a share drive? I got the following  but keep getting access denied. I checked credential and are correct. Appreciate your help.

invoke-Command -ComputerName mypc-ScriptBlock {

Import-Module \\server\share\PSRemoteRegistry-PassThru

$a = Get-Date

$date = $a.ToShortDateString() + " "  + $a.ToShortTimeString()

New-RegKey  -Hive CurrentUser -Key "SOFTWARE\Microsoft\Office\14.0\Word\Security\Trusted Locations" -Name Location3 -PassThru

Set-RegDWord -Hive CurrentUser -Key "SOFTWARE\Microsoft\Office\14.0\Word\Security\Trusted Locations\Location3" -Value AllowSubfolders -Data  -Force

Set-Regstring -Hive CurrentUser -Key "SOFTWARE\Microsoft\Office\14.0\Word\Security\Trusted Locations\Location3" -Value Path -Data "C:\Program Files (x86)\Microsoft Office\Office14\STARTUP\" -Force

Set-Regstring -Hive CurrentUser -Key "SOFTWARE\Microsoft\Office\14.0\Word\Security\Trusted Locations\Location3" -Value Description -Data "Use for Mathtype" -Force

Set-Regstring -Hive CurrentUser -Key "SOFTWARE\Microsoft\Office\14.0\Word\Security\Trusted Locations\Location3" -Value Date -Data $date -Force


  } -Credential $cred

July 23rd, 2015 7:28pm

No - it is dis-allowed by security.  Search for "second hop restriction".
Free Windows Admin Tool Kit Click here and download it now
July 23rd, 2015 7:35pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics