PIRATED 20130913 2147

PIRATED 20130913 2147

NOTE: This content appears to have been plagiarized. Please leave a comment or email tnwiki at Microsoft (with a link to this article) if we are mistaken. The content was pulled from the following source:
The community rules state:
  • "Someone else has relevant content and you want to help them share it with the world. It's a nice thought, but do not copy other people's content to the Wiki, even if the owner said it was OK."



Summary: Learn how to use the Windows PowerShell 3.0 Invoke-Command cmdlet to create a disconnected session.

Hey, Scripting Guy! Question How can I run a command on a remote computer running Windows PowerShell 3.0 in a disconnected session?

Hey, Scripting Guy! Answer Use the Invoke-Command cmdlet with the Disconnected parameter, as shown here. Note that icm is an alias for Invoke-Command.

icm -ComputerName dc2 -ScriptBlock {1..20 | %{get-date;gps;sleep 600} } -Disconnected

 

Leave a Comment
  • Please add 1 and 1 and type the answer here:
  • Post
Wiki - Revision Comment List(Revision Comment)
Sort by: Published Date | Most Recent | Most Useful
Comments
  • Carsten Siemens edited Revision 1. Comment: Pirated Content - see my comment

Page 1 of 1 (1 items)
Wikis - Comment List
Sort by: Published Date | Most Recent | Most Useful
Posting comments is temporarily disabled until 10:00am PST on Saturday, December 14th. Thank you for your patience.
Comments
  • Carsten Siemens edited Revision 1. Comment: Pirated Content - see my comment

  • NOTE: This article was reported as Pirated/Plagiarized Content (content you didn't write) and will be removed. Please do not steal content from others. If you feel we are mistaken, please leave a comment or email tnwiki at Microsoft with a link to this article and with clear and detailed reasons why you own the content or have explicit permission from the author.

    Content was taken from: "PowerTip: Run a Remote PowerShell Command in a Disconnected Session"

    Published by The Scripting Guys on 20 Nov 2012

    blogs.technet.com/.../powertip-run-a-remote-powershell-command-in-a-disconnected-session.aspx

Page 1 of 1 (2 items)