locked
How to Add PowerShell snapin on REMOTE servers RRS feed

  • Question

  • HI All,

    I have 1 query, can u anybody help me to get it done

    I have created ps1 file that will make remote connection on series of servers(max 4 server at a time)

    and execute Get/Set-SPContentDeploymentJob cmd remotly- to execuute we have to add psSnapin,

    I am able to execute commands and getting back output but unable to execute cmdlets on remote server that needs PSSnapin,

    I tried

    by calling remote ps1 file Invoke-Command -ComputerName $get_Server_names[0] -ScriptBlock {C:\top\SP-Monitor.ps1} -credential $user 

    by calling Local ps1 file Invoke-Command -ComputerName $get_Server_names[0] -FilePath 'C:\op\CDJ Logs\Get_CDJ_Dtl.ps1'

    but it gets hang/not sure-take 10+mins but snapin doesnt adds and no further execution happnes

    Tuesday, August 21, 2012 2:45 PM