First and foremost
thing is we need to set execute policy to bypass in both client and server
machines.
Script that we need
to execute in the client machine:
param ($DropLocation="\\MD1DEVVSPEAPP01\Scripts", $Server="MD1DEVVSPEAPP01")
$secpasswd = ConvertTo-SecureString "68qZxpTi" -AsPlainText -Force;
$cred = New-Object System.Management.Automation.PSCredential ("JDA\jnetsvcQAfarm",
$secpasswd);
Invoke-Command -Args ($DropLocation) -Script {
param($DropLocation)
Add-PSSnapin
Microsoft.SharePoint.Powershell;
$script =
Join-Path $DropLocation "SPServicesStart.ps1"
. $script
} -ComputerName $Server -auth CredSSP -cred $cred
No comments:
Post a Comment