PowerShell remoting: Results not returned using Enter-PSSession vs Invoke-Command???


so code generates output when using enter-pssession same code not return data using invoke-command (using credssp) script.

here is the relevant excerpt script:

able use get-spweb.recylce() method when using enter-pssession turn code script invoke-command not access method.  gives?  still logged in same user.  suppose permissions issue login never changed

if ((get-pssnapin microsoft.sharepoint.powershell -erroraction silentlycontinue) -eq $null) {       add-pssnapin microsoft.sharepoint.powershell     }      $webapps = (get-spwebapplication | % {$_.url})     $listtemplate = [microsoft.sharepoint.splisttemplatetype]::documentlibrary     foreach ($webapp in $webapps) {       $appdetails = get-spwebapplication $webapp       $appdetails.grantaccesstoprocessidentity("$env:userdomain"+"\$env:username")       $spweb = get-spweb -identity $webapp       $doclibname = "msotest$($appdetails.displayname)".split(".")[0]       $doclibname += "_documentlibrary"                    try {          $library = $null         $library = $spweb.lists["$doclibname"]       }       catch {out-null}              if ($library) {         #if document library exist, delete         $spfolder = $spweb.getfolder("$doclibname")          $spfolder.recylce() | out-null       } 



are sure recylce() ??

how recycle() ??



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

some help on Event 540

WMI Repository 4GB limit - Win 2003 Ent Question

Event ID 1302 (error 1307) DFS replication service encountered an error while writing to the debug log file