Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Change DocumentID remote-pssession

$
0
0

Hello All,

I have issue runnig script from my PC, as it seems when i run it locally on the server it works fine, but from my PC i get access is denined error. I'm trying to change DocumentID on a site collection.

I run as domain user which has full control on a web app trough app policy, and is site collection admin (so not issue there).

Here is the code:

cls
$command = {
	$s = New-PSSession -ComputerName MYSERVER -Credential DOMAIN\account -Authentication Credssp
	Enter-PSSession -Session $s
	invoke-command -Session $s -scriptblock {
		Add-PSSnapin "Microsoft.SharePoint.Powershell"
		$DocIDPrefix = "TEST_DOCID"
		$site = Get-SPSite https://mysite/sites/TestSite
		[Microsoft.Office.DocumentManagement.DocumentId]::SetDefaultProvider($site)
		[Microsoft.Office.DocumentManagement.DocumentId]::EnableAssignment($site, $DocIDPrefix, $true, $true, $true, $false)
		}
}
powershell.exe -noexit -Command $command
When i connect using RDP the the server using same credentials and run this it works fine:
$DocIDPrefix = "TEST_DOCID"
		$site = Get-SPSite https://mysite/sites/TestSite
		[Microsoft.Office.DocumentManagement.DocumentId]::SetDefaultProvider($site)
		[Microsoft.Office.DocumentManagement.DocumentId]::EnableAssignment($site, $DocIDPrefix, $true, $true, $true, $false)


Any hints?


Kind regards, Dusan Tomic


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>