Using PowerShell Remoting with Workflows and Functions

Hello,
I have an existing set of scripts with a mixture of Modules containing the functions, Workflows that call the functions and Main script that invokes the workflows.
Step 1: The Main script picks up the list of servers from a custom db and invokes the relevant workflow for further operation
Step 2: The workflow runs as foreach parallel and calls a function by passing the server name as a parameter
Step 3. The function in the module does the real job
All of this runs, from a central location. 90% of the server are geo dispersed. This seems to be a bit of a concern in terms of turnaround time is too high. 
Hence, I would like to use WinRM (PowerShell Remoting). I have configured WinRM on all the Server with Firewall Exception.
My Queries:
1. Apart from using Enter-PSSession or Invoke-Command, are there any other CMDLet's?
2. Say for example; I plan to use Enter-PSSession, should I embed the code with Workflow?
3. How will it retrieve the output?
Please advice, Thanks
Rajiv

You cannot use Enter-PSSession in a script.  
It's only intended to be used interactively from the console. If you try to use it in a script, the script will run the subsequent commands on the local system, not in the remote session.
You'll need to use Invoke-Command, and you'll have to include the function definitions in the invoked script block, since those functions will not exist in the remote sessions.
[string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

Similar Messages

  • Using apple remote with macbook and hulu or netflix

    Can an apple remote be used to run netflix of hulu desktop when my Macbook is connected to my LCD tv?

    You might want to inquire in the MacBook hardware forum:
    http://discussions.apple.com/category.jspa?categoryID=218

  • The message function on my Ipad just quit working.  I was using it while in Mexico and it just quit.  I have come home and synced my Ipad with Itunes and function still does not work.  How do I get this function to work again?

    The message function on my Ipad just quit working.  I was using it while in Mexico and it just quit.  I have come home and synced my Ipad with Itunes and function still does not work.  How do I get this function to work again?

    When I use find file http://www.macupdate.com/app/mac/30073/find-file (which does tend to find files that "Finder" can't), it's not coming up with any other itunes library files that have been modified in the past week, which I know it would have been - unfortunately, I don't have a very recent backup of the hard drive.  It would be a few months old so it wouldn't have the complete library on it....any ideas?  I'm wondering if restarting the computer might help but have been afraid to do so in case it would make it harder to recover anything...I was looking at this thread https://discussions.apple.com/thread/4211589?start=0&tstart=0 in the hopes that it might have a helpful suggestion but it's definitely a different scenario.

  • Populating a Combobox using Remoting with AMF and PHP

    Hello all
    I am using Zend framework and Flex 3.4 to create a webapp. I am stuck at how to populate a combobox dynamically using the service I created in PHP.
    In some of examples I saw that result of database query was being converted into XML and then sent to Flex. This seems a little too time-consuming if I have to do it every time. I saw some examples in Adobe Docs about Remoting with AMF and PHP. That seems like a better approach although how it would be applicable here is beyond me right now.
    Can somebody guide me in correct direction?
    Thanks and Regards
    Shivik

    Try this: http://code.google.com/p/as3flexdb/ is very easy to use and it
    will help.
    All you need to populate a combo is:
    <mx:ComboBox dataProvider="{query.Records} /

  • Using Apple remote with macbook display closed

    Hi ,
    I have a macbook connected to LCD TV with HDMI connection .
    Is there a way to use Apple remote with display closed .
    examples of using apple remote with display closed would be
    (1) waking the macbook with apple remote
    (2) putting the macbook to sleep with apple remote
    (3) Shutting down the macbook with apple remote
    (4) accessing front row (using LCD TV as Display )
    while doing this should I connect the macbook to power source.
    please point me to any documentation / solutions available .
    I don't have any external keyboard or mouse connected to macbook . I just want to use Apple remote to do the above functions .
    Thanks
    Suresh
    macbook   Mac OS X (10.4.9)  

    Hi suresh,
    as mentioned here:
    http://docs.info.apple.com/article.html?artnum=86286
    and
    http://docs.info.apple.com/article.html?artnum=300562
    you must have to have a keyboard or mouse to trigger the macbook wake up from sleep when you close the lid.
    usb mouse is not that expensive and you can start with that.
    Good Luck

  • HT204378 2 iOS8.1.1 devices can't connect via BT "Using Keynote Remote with Bluetooth" - HT6112

    I'm unable to get to iOS devices to connect via Bluetooth for Keynote control.  It's described above under the heading "Using Keynote Remote with Bluetooth".  Am I missing something?  I see the article mentions iOS8 so I know it's been updated recently.   I also see that this hasn't worked in the past.  Curious that the articles suggests it can be done now.
    I have 3 iOS devices all 8.1.1.
    iPhone 5
    iPhone 5s
    iPad 3rd Gen
    Thanks,
    Russell

    Just talked to Bose and learned the solution.
    Reset the speaker ....hold down the bluetooth button until you hear a tone. Delete the Bose in the Bluetooth Device directory on the iPad. When it is automatically rediscovered it will connect.
    Worked for me .....

  • How to use union statement with declare & set function?

    Hi Experts,
            i  have small query about how to use union statement with declare & set function?
    Example as below :
    DECLARE @name AS date
    Declare @name2  AS date
    /* SELECT FROM [2013].[dbo].[OINV] T0 */
    /* WHERE */
    SET @name = /* T0.DocDate */ '[%1]'
    SET @name2 = /* T0.DocDate */ '[%2]'
    select  '2013',t5.U_salmannm,t1.CardName,t2.sumapplied as CollectionAmount,t2.DcntSum ,t3.DocTotal as InvoiceTotal,
    datediff(dd,t3.DocDate,t1.Docdate) as Days
    from 2013.dbo.orct t1
    inner join 2013.dbo.RCT2 t2 on t1.DocNum = t2.DocNum
    left join 2013.dbo.oinv t3 on
    t3.docentry = t2.baseAbs
    inner join 2013.dbo.ocrd t4 on t1.Cardcode = t4.CardCode
    inner join [2013].[dbo].[@CQ_RTSM] t5 on t4.U_BeatCode = t5.U_RoutCode
    where t2.DcntSum <> 0.000000 and t3.DocDate between [%1] and [%2]
    Union
    /* SELECT FROM [2014].[dbo].[OINV] T0 */
    /* WHERE */
    SET @name = /* T0.DocDate */ '[%1]'
    SET @name2 = /* T0.DocDate */ '[%2]'
    select  '2014',t5.U_salmannm,t1.CardName,t2.sumapplied as CollectionAmount,t2.DcntSum ,t3.DocTotal as InvoiceTotal,
    datediff(dd,t3.DocDate,t1.Docdate) as Days
    from 2014.dbo.orct t1
    inner join 2014.dbo.RCT2 t2 on t1.DocNum = t2.DocNum
    left join 2014.dbo.oinv t3 on
    t3.docentry = t2.baseAbs
    inner join 2014.dbo.ocrd t4 on t1.Cardcode = t4.CardCode
    inner join [2014].[dbo].[@CQ_RTSM] t5 on t4.U_BeatCode = t5.U_RoutCode
    where t2.DcntSum <> 0.000000 and t3.DocDate between [%1] and [%2]

    You have to create stored procedure in SQL only .
    Like u must have create for Crystal .
    You can execute procedure in query manager but you have to enter parameter manually..
    example
    Exec @Test '20140101' '20140501'
    Every time user has to enter it manually in yyyymmdd format in case of date parameters.
    Example
    Create Proc [@Test]
    as begin
    DECLARE @name AS date
    Declare @name2  AS date
    /* SELECT FROM [2013].[dbo].[OINV] T0 */
    /* WHERE */
    select  '2013',t5.U_salmannm,t1.CardName,t2.sumapplied as CollectionAmount,t2.DcntSum ,t3.DocTotal as InvoiceTotal,
    datediff(dd,t3.DocDate,t1.Docdate) as Days
    from 2013.dbo.orct t1
    inner join 2013.dbo.RCT2 t2 on t1.DocNum = t2.DocNum
    left join 2013.dbo.oinv t3 on
    t3.docentry = t2.baseAbs
    inner join 2013.dbo.ocrd t4 on t1.Cardcode = t4.CardCode
    inner join [2013].[dbo].[@CQ_RTSM] t5 on t4.U_BeatCode = t5.U_RoutCode
    where t2.DcntSum <> 0.000000 and t3.DocDate between @Name and @Name2
    Union
    /* SELECT FROM [2014].[dbo].[OINV] T0 */
    /* WHERE */
    select  '2014',t5.U_salmannm,t1.CardName,t2.sumapplied as CollectionAmount,t2.DcntSum ,t3.DocTotal as InvoiceTotal,
    datediff(dd,t3.DocDate,t1.Docdate) as Days
    from 2014.dbo.orct t1
    inner join 2014.dbo.RCT2 t2 on t1.DocNum = t2.DocNum
    left join 2014.dbo.oinv t3 on
    t3.docentry = t2.baseAbs
    inner join 2014.dbo.ocrd t4 on t1.Cardcode = t4.CardCode
    inner join [2014].[dbo].[@CQ_RTSM] t5 on t4.U_BeatCode = t5.U_RoutCode
    where t2.DcntSum <> 0.000000 and t3.DocDate between
    between @Name and @Name2
    end

  • I'm using the remote with my iPod connected to iTunes why can't I search playlists on the iPod? It only lets me search playlists in iTunes

    I'm using the remote with my iPod connected to iTunes why can't I search playlists on the iPod? It only lets me search playlists in iTunes and only let's me see the current playlist on the iPod only

    You can only sync to one computer.
    You would have to transfer purchases, but the apple ID would need to be the same.
    Or find a 3rd party app to transfer content.

  • If I use the remote with two macbooks in the same room both of them answer

    If I use the remote with two macbooks in the same room, the two of them answer. So if the person sitting near me is doing something else I interrupt them... this is quite annoying!
    Does anyone know how to solve this? Should I report it as a bug? Where?

    Hi Carito,
    It is not a bug, all you have to do is pairing them.
    Here is the link:
    http://docs.info.apple.com/article.html?artnum=302545
    and:
    http://docs.info.apple.com/article.html?path=Mac/10.4/en/mh2275.html
    Good Luck.

  • Printer is overprinting old jobs on top of new jobs.  Using a Mac with OSx and a HP photosmart for over a year.  this just started happening.

    Printer is overprinting old jobs on top of new jobs.  Using a Mac with OSx and a HP photosmart for over a year.  this just started happening.

    RReset printing system again and the restart in Safe Mode . This will clear some caches,to do this hold down the Shift key when you hear the startup tone until a progress bar appears, after it has fully booted restart normally and add the printer.

  • How do I use apple remote with iPhone 5 ?

    How do I use apple remote with iPhone 5 ?

    Iphones dont have ir at all which the remote use for comm
    Only option is to use a dock which have ir

  • Using iPhone 4s with IOS5 and my Music icon has disappeared.  How do I get it back?  Please.

    Using iPhone 4s with IOS5 and my Music icon has disappeared.  Please help me to get it back.

    It should be in your applications folder.  Locate it; click and hold onto it then drag it back to where it was.

  • How do I re-pair the white Remote with iTunes and/or AppleTV 1

    how do I re-pair the white Remote with iTunes and/or AppleTV 1...?
    iMac 8,1 - OSX10.6.8

    Note that our test system may show more or different columns than yours, but what you see in this screenshot is our iTunes 11 music library in "Songs" view, sorted by artist. The major difference from prior versions of iTunes is the lack of the sidebar that gave you quick access to all of your content.
    Don't worry, it's still available! We just have to turn it on. To do so, go to the View menu and choose "Show Sidebar," as shown in the image below:
    http://www.macobserver.com/tmo/article/how-to-restore-the-sidebar-in-itunes-11
    I saw this on their web site... Hope it helps.
    WEU

  • How to use EJB Remote with Netbeans7.0 ?

    I try to create Session Bean in Netbeans 7.0 but when I select Remote then I have to select Java Application in Netbeans. It different from Netbeans 6.8 ,6.9 which in Netbeans6.8, 6.9 not have dropdown for select Java Application when we choose Remote. So I don't know how to use EJB Remote in Netbeans7.0 then I click finish. After that, I create Project is Enterprise Application Client. but in Main.java at this line
    BLSessionRemote obj = (BLSessionRemote)ctx.lookup("TestBean");
    It can't find BLSessionRemote in Session Beans. How to use EJB Remote with Netbeans7.0 ?

    Why don't you ask this question in the Netbeans mailing lists, where it belongs. Come here when you have problems with code you wrote yourself.

  • I am from India using my iphone4 with Vodafone and  firmware version 5.0.1(9A405). I am unable to access 3G from my device as the CELLULAR DATA NETWORK option in the settings is missing. Any methods or options for fixing the same????

    I am from India using my iphone4 with Vodafone and  firmware version 5.0.1(9A405). I am unable to access 3G from my device as the CELLULAR DATA NETWORK option in the settings is missing. Any methods or options for fixing the same????

    I am from India using my iphone4 with Vodafone and  firmware version 5.0.1(9A405). I am unable to access 3G from my device as the CELLULAR DATA NETWORK option in the settings is missing. Any methods or options for fixing the same????

Maybe you are looking for