Jason,
We'll need to see the error you're receiving when you run the script off the D:\ drive, as well as the script itself. You might want to edit the script to insert some Write-Host, Write-Warning, or Add-Content statements to assist with debugging the process. Without this information, I doubt I can help you much more. Cheers, Trevor Sullivan From: listsad...@lists.myitforum.com [mailto:listsad...@lists.myitforum.com] On Behalf Of jlos...@mpi.mb.ca Sent: Thursday, January 16, 2014 11:12 AM To: scripting@lists.myitforum.com Subject: RE: [scripting] Invoke-Command This works from SERVERB directly. Invoke-Command -ComputerName ServerB -ScriptBlock { Get-Process} I tried it using with the credential argument and it also works Invoke-Command -ComputerName ServerB -ScriptBlock { Get-Process} -Credential $credential But with the DLS script it does not. Thanks, Jason From: listsad...@lists.myitforum.com <mailto:listsad...@lists.myitforum.com> [mailto:listsad...@lists.myitforum.com] On Behalf Of Trevor Sullivan Sent: Thursday, January 16, 2014 10:50 AM To: scripting@lists.myitforum.com <mailto:scripting@lists.myitforum.com> Subject: RE: [scripting] Invoke-Command Jason, Can you send a screenshot of the issue? Your font is rather challenging to read. Have you tried a simpler command, just for starters? When all else fails, take it back to the basics. Invoke-Command -ComputerName serverb -ScriptBlock { Get-Process; }; Cheers, Trevor Sullivan From: listsad...@lists.myitforum.com <mailto:listsad...@lists.myitforum.com> [mailto:listsad...@lists.myitforum.com] On Behalf Of jlos...@mpi.mb.ca <mailto:jlos...@mpi.mb.ca> Sent: Thursday, January 16, 2014 10:25 AM To: scripting@lists.myitforum.com <mailto:scripting@lists.myitforum.com> Subject: RE: [scripting] Invoke-Command Here is the error we receive cmdlet Get-Credential at command pipeline position 1 Supply values for the following parameters: Credential An error occured trying to connect to SERVERB DEBUG: Attempting to execute the following command: Invoke-Command -ComputerName SERVERB -ScriptBlock {param() & 'D:\DLS Security Manag ement Scripts\display_mf_user.ps1' -userID } -ArgumentList @( user) -Credenti al System.Management.Automation.PSCredential -SessionOption System.Management.Au tomation.Remoting.PSSessionOption -ErrorAction Stop Thanks, Jason From: listsad...@lists.myitforum.com <mailto:listsad...@lists.myitforum.com> [mailto:listsad...@lists.myitforum.com] On Behalf Of Trevor Sullivan Sent: Thursday, January 16, 2014 10:17 AM To: scripting@lists.myitforum.com <mailto:scripting@lists.myitforum.com> Subject: RE: [scripting] Invoke-Command Jason, What do you mean "does not work?" Are you getting an error? If so, what is the error? FYI, you have to enable Windows Remote Management (WinRM) to use Invoke-Command. Use Enable-PSRemoting -Force or Set-WsmanQuickConfig, or use Active Directory Group Policy to enable WinRM. Cheers, Trevor Sullivan From: listsad...@lists.myitforum.com <mailto:listsad...@lists.myitforum.com> [mailto:listsad...@lists.myitforum.com] On Behalf Of jlos...@mpi.mb.ca <mailto:jlos...@mpi.mb.ca> Sent: Thursday, January 16, 2014 10:03 AM To: scripting@lists.myITforum.com <mailto:scripting@lists.myITforum.com> Subject: [scripting] Invoke-Command Hi, we have a set of scripts that run on ServerA and they do not run on identical ServerB The Invoke-Command does not work locally or remotely on ServerB Any ideas? Thanks, Jason Loster Senior IT Analyst IT Security, Compliance and Risk Management Manitoba Public Insurance 708-234 Donald St. Winnipeg, MB, R3C 4A4 <mailto:jlos...@mpi.mb.ca> jlos...@mpi.mb.ca