Login To Remotely To Run Powershell Scrip

Last post 03-29-2016, 11:34 AM by kloganathan. 8 replies.
Sort Posts: Previous Next
  • Login To Remotely To Run Powershell Scrip
    Posted: 03-16-2016, 3:08 PM

    Hi,

    I'm working on a workflow that would install CV SP on the CS and MAs or go through the same steps of preparing for an CV SP without pushing out updates for MS patchings. This workflow works great. Now I would like to take it a step further and stop all backup services on the CS and MAs, after the scheduler is disabled, all jobs are suspended, DR backup and DB Maintenancecompletes.  This would avoid the likelyhood of a rogue job starting and trying to write to the DDB when it is about to go down for patches. Which would cause the DDB to become corrupt.

    Both of the scripts below work as intended when running them locally. I'm having trouble figuring out how to configure the workflow to log into the CS and MAs that I would pass through a For Each fuction and run the scripts below. I've tried using the PSExec which is a built in fuction but that is not working. I'm also not sure if I have it configured correctly.

    I have attached a pic of how PSExec fuction is configured.

    Thanks in advance!!!

     

    Error Code: [19:857] Description: failed to launch app (remotely) Source: lab1-cs01, Process: Workflow

     

    stopServices.ps1

    ## Stop all CommVault Services
    $serviceList = Get-Service Gx* | % {Stop-Service ($_.Name) -Force -Confirm:$false}

    ## Changes all CommVault Services Startup Type to Manual
    $serviceList = Get-Service Gx* | %{Set-Service ($_.Name) -StartupType "manual"}

     

    startServices.ps1

    ## Changes all CommVault Services Startup Type to Manual
    $serviceList = Get-Service Gx* | %{Set-Service ($_.Name) -StartupType "automatic"}

    ## Start all CommVault Services
    $serviceList = Get-Service Gx* | % {Stop-Service ($_.Name) -Confirm:$false}


    Attachment: PSExec.png
  • Re: Login To Remotely To Run Powershell Scrip
    Posted: 03-16-2016, 3:27 PM

    How are you patching the machines? Why not do push install of the updates instead of doing powershell. Also I dont think you need to worry about ddb corruption. The patch install code waits for the ddb to go down

  • Re: Login To Remotely To Run Powershell Scrip
    Posted: 03-17-2016, 7:58 AM

    Hi,

    I have a several machines that I have to log into, to apply MS Security patches.  I know CV waits for the DDB to go down, but what I don't want to do is have a server reboot multiple times while the services are still up and potentialy start processing data before it is rebooted again.

    Having the script stop the service would save me a lot of time after I log into the systems.

    My workflow has 2 options:

    Option 1 (CV Updates):Kills SQL/Exchange/NDMP jobs, suspends all other jobs, run DR Backup, Put all MAs in Maintenance Mode, run DB Maintenace Full, push updates to the CS, push updates to MA, re-enable MAs, rund DR Backups, renable the Scheduler, resume all suspended backups.

    Options 2 (MS Patching):Kills SQL/Exchange/NDMP jobs, suspends all other jobs, run DR Backup, Put all MAs in Maintenance Mode, run DB Maintenace Full, suspend the workflow, after MS Patching manually resumes the WF to re-enable MAs, rundDR Backups, renable the Scheduler, resume all suspended backups.

    I would like to configure the workflow to stop the backup services and change the startup type to manual to ensure that before the CV services are stopped on the server before MS patches are applied.  This will ease my paranoia about having my DDB seal due to corruption because someone took the MA out of Maintenance Mode and kicked off a test backup for a newly provisioned customer.

  • Re: Login To Remotely To Run Powershell Scrip
    Posted: 03-17-2016, 11:52 AM

    Just to rule out one thing can you put the arguments to powershell in the arguments field?

  • Re: Login To Remotely To Run Powershell Scrip
    Posted: 03-17-2016, 1:56 PM

    I tried that and it does not work and the same error is being displayed.

     

    Error Code: [19:857] Description: failed to launch app (remotely) Source: lab1-cs01, Process: Workflow

  • Re: Login To Remotely To Run Powershell Scrip
    Posted: 03-17-2016, 2:43 PM

    ok. The PSExec activity internally uses the paexec utility.

    https://www.poweradmin.com/paexec/

     

    Can you try running the paexec command outside the workflow with the same arguments and see if it works or gives the same error?

  • Re: Login To Remotely To Run Powershell Scrip
    Posted: 03-17-2016, 10:39 PM

    Hi,

     

    We already have an workflow that  install windows patches on the given clients.

    We are going to post the same in software store and give it to all customers.

     

    Karthik

  • Re: Login To Remotely To Run Powershell Scrip
    Posted: 03-29-2016, 9:27 AM

    When will it be availble on the download store?

  • Re: Login To Remotely To Run Powershell Scrip
    Posted: 03-29-2016, 11:34 AM

    It should be available by April 8th.

The content of the forums, threads and posts reflects the thoughts and opinions of each author, and does not represent the thoughts, opinions, plans or strategies of Commvault Systems, Inc. ("Commvault") and Commvault undertakes no obligation to update, correct or modify any statements made in this forum. Any and all third party links, statements, comments, or feedback posted to, or otherwise provided by this forum, thread or post are not affiliated with, nor endorsed by, Commvault.
Commvault, Commvault and logo, the “CV” logo, Commvault Systems, Solving Forward, SIM, Singular Information Management, Simpana, Commvault Galaxy, Unified Data Management, QiNetix, Quick Recovery, QR, CommNet, GridStor, Vault Tracker, InnerVault, QuickSnap, QSnap, Recovery Director, CommServe, CommCell, SnapProtect, ROMS, and CommValue, are trademarks or registered trademarks of Commvault Systems, Inc. All other third party brands, products, service names, trademarks, or registered service marks are the property of and used to identify the products or services of their respective owners. All specifications are subject to change without notice.
Close
Copyright © 2019 Commvault | All Rights Reserved. | Legal | Privacy Policy