Using invoke-command to run 'vssadmin list writers' on several servers, how do I sort the results from each server?

Hi I am a PS virgin so be gentle with me. I am trying to run the vssadmin list writers command on 8 servers.
invoke-command -computername srv-bx-hvc1, srv-bx-hvc2, srv-bx-hvc3, srv-bx-hvc4,
srv-bx-hvc5,
srv-bx-hvc6,
srv-bx-hvc7, srv-bx-hvc8
-command {vssadmin list writers}
The command works but I cannot tell which response is from what server.
The objective whould be to eventually have the command so I know which server has  failed vss writers if possible restart them automatically.
Any thoughts on how to achieve this lofty ideal??
Thanks

This is a tweak to the example that JRV listed.  I am using this code to just pull the information about the Exchange Writers but you could adapt it for others.
$servers='sdcexmail001','sdcexmail002','sdcexmail003','sdcexmail004','sdcexmail005'
$servers | %{
$sb={
$writers=vssadmin list writers
New-Object PSObject -Property @{Server=$_;Writers=$writers}
$ServerName = $_
$out = invoke-command -computername $_ -scriptblock $sb -Argumentlist $_
$WritersData = $Out.Writers
for ($I = 0;$I -le $WritersData.Count -1;$I++)
$Data = $WritersData[$I]
If($Data.StartsWith('Writer name:'))
$WriterName = ($Data.Split(':')[1]).Trim()
$WriterID = ($WritersData[$I+1].Split(':')[1]).Trim()
$WriterInstID = ($WritersData[$I+2].Split(':')[1]).Trim()
$State = ($WritersData[$I+3].Split(':')[1]).Trim()
$LastError = ($WritersData[$I+4].Split(':')[1]).Trim()
$info = [Ordered]@{
'ComputerName' = "$ServerName";
'WriterName' = "$WriterName";
'WriterID' = "$WriterID";
'WriterInstID' = "$WriterInstID";
'State' = "$State";
'LastError' = "$LastError";
$object = New-Object -TypeName psobject -Property $info
$object | Where-Object {$_.WriterName -like '*Microsoft Exchange*'} | Select-Object -Property ComputerName,WriterName,State,LastError

Similar Messages

  • Paramerterized Interactive Reports - when running or clicking on a specific page how can I stop the report from rendering BEFORE the user enters parameters.

    I wasn't able to display in pic in this post 
    But it would look something like this
    Order type  -ALL- (select list)                GO (button)
    When I come into this page - the report renders ALL the data because the SQL is as follows
      AND ol.unit_selling_price <> 0
               AND(ordertype.transaction_type_id = :P1_TEXT OR :P1_TEXT IS NULL)
                ORDER BY   3
    Its setup this way because I want all records returned if the user makes no selections BUT CLICKS the "GO" or "SEARCH" button.
    I just don't all records rendered upon initial screen entry and without user having selection options....I.E initiate via a button.
    Thanks

    Hi,
    Here is what you can do with out any hidden items.
    on report condition select request = e1
    and enter  GO
    Now when you hit the Go button which actually submits the page to perform the search right?
    Now create a branch and redirect to same page and in REQUEST enter: GO  (But make sure you are selecting when GO button clicked and make it first branch if you have any unconditional branches)
    So the report will be seen by the user only when he hits the GO button from that screen.
    Simple enough right?
    Thanks,
    Ramesh P.

  • I recently had to back up itunes play lists to external hard drive, how do I restore the library from the external hard drive to the new computer

    I recently had to back up itunes play lists to external hard drive whilst computer was fixed. reinstalled itunes but dont know how to reinstall my music from external hard drive. help?

    The same way the library was copied/moved to the external drive.
    Copy it from location A to location B.
    Then point iTunes to the correct library.

  • 2012R2 server System writer missing in the vssadmin list writers

    Hi,
    I have some problem with a brand new 2012R2 standard server.
    we were able to backup the server from the beginning without problems with the built-in windows backup application.
    After installing Solarwinds and SQL server on it, now we have this error in the event logs if we try to backup system state:
    The operation ended before completion. Detailed error: The system writer is not found in the backup.
    If I check the VSSAdmin list writers, system writer is missing.
    We also have this error in the event logs :
    Cryptographic Services failed while processing the OnIdentity() call in the System Writer Object.
    Details:
    AddWin32ServiceFiles: EnumServicesStatusEx API for service enumeration failed
    System Error:
    The data is invalid.
    I did not find anything on the AddWin32ServiceFiles: EnumServicesStatusEx API... and the problem for the system writer seems to start from this error.
    Anyone have an idea ?
    thanks
    Benoit

    Hi Benoit,
    As the error mentioned Cryptographic Service, please try to restart that service to see if it will help. In fact, system writer is registered in Cryptographic Service. 
    • Any errors on system/application log?
    • Run vssadmin list writers again to see if you can find System Writer?
    If no system writer, try to run the command in command prompt:
    SC.EXE SDSHOW EVENTSYETEM
    • If the output is like below, that means it is missing the Service Logon User (missing the entry (A;;CCLCSWLOCRRC;;;SU) )
    D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;IU)S:(AU;FA;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;WD)
    • Then you can reset the eventsystem permission:
    Sc.exe sdset eventsystem D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;IU)(A;;CCLCSWLOCRRC;;;SU)S:(AU;FA;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;WD)
    • Restart both the COM+ Event System and Cryptographic Services
    • Run VSSADMIN LIST WRITERS again and see if system writer is back.
    NOTEs:If the problem on your side is indeed related to service permission, you can check the GPO setting on your side to see if there is any change on the COM+ Event System Service.
    If the system writer is back, please test if backup function is back to work. 
    If you have any feedback on our support, please send to [email protected]

  • How can I decide the size of HANA server when using DMO of SUM ?

    Hi expert,
    I want to execute DB migration from MS SQL to SAP HANA by using DMO of SUM.
    So I have a question.
    How can I decide the size of HANA server when using DMO of SUM ?
    Now I have MS SQL in windows server.
    But in order to use HANA , I have to prepare Linux server.
    I want to know How can I decide the size of this Linux server.
    Can I expect the function of data compression in HANA ?
    Thanks in advance .
    Kazuki.

    Kazuki,
    Please take attetion:
    Your linux box already created = Application server:
    Application Server
    Based on the measurements SAP doesn't expect any changes concerning CPU, memory and network requirements for the ABAP application server. This means that the existing hardware and network infrastructure can still be used. Please check the PAM (www.service.sap.com/pam) for further details.
    SAP HANA Appliance ( porvided by your hardware partner)
    Consider SAP Note recommendation for HANA Main Memory, HANA CPU and HANA Disk Space.
    Regards,
    Edinaldo Junior

  • Vssadmin list writers empty

    Hi,
    On my Windows Server 2003 when running the command vssadmin list writers it is returning an empty list. So no writers at all.
    I found a support article that mentioned to re-register the following:
    regsvr32 ole32.dll
    regsvr32 vss_ps.dll
    Vssvc /Register
    regsvr32 /i swprv.dll
    regsvr32 /i eventcls.dll
    regsvr32 es.dll
    regsvr32 stdprov.dll
    regsvr32 vssui.dll
    regsvr32 msxml.dll
    regsvr32 msxml3.dll
    regsvr32 msxml4.dll
    The thing is I have no msxml.dll and no msxml4.dll in my %windir%\system32 folder. MSXML6 is installed because this is a SQL 2005 server.
    I also found an article which suggested to remove the subscriptions through the registry. This didn't help.
    When running the command I get error events:
    ID 8193
    Volume Shadow Copy Service error: Unexpected error calling routine CoCreateInstance. hr = 0x80040154.
    ID 20
    Volume Shadow Copy Service error: A critical component required by the Volume Shadow Copy service is not registered. This might happened if an error occurred during Windows setup or during installation of a Shadow Copy provider. The error returned from CoCreateInstance on class with CLSID {faf53cc4-bd73-4e36-83f1-2b23f46e513e} and Name VSSEvent is [0x80040154].

    This one solved!
    When re-registering the components we didn't ran the command from the root instead of %windir%\system32. Now everything is okay.

  • Installing SQL Server 2012 remotely via Powershell using Invoke-Command

    I am trying to perform a SQL Server 2012 command line installation using Powershell Invoke-Command on Windows 2012 Datacenter.
    The code I am using is as follows:
     $ret = Invoke-Command -ComputerName $COMPUTER -ArgumentList $MEDIA,$ACTION,$FEATURES,$INSTALLDIR,$INSTANCEID,$INSTANCENAME,$SQLDATADRIVE,$SQLLOGDRIVE,$DOMAIN,$SQLSERVERSERVICEUSER,$SQLSERVICEPASSWORD,$PRODUCTKEY,$SQLSERVERSA,$username,$ADMINPASSWD
    -Credential $cred -ScriptBlock {
      param($MEDIA,
         $ACTION,
         $FEATURES,
         $INSTALLDIR,
         $INSTANCEID,
         $INSTANCENAME,
         $SQLDATADRIVE,
         $SQLLOGDRIVE,
         $DOMAIN,
         $SQLSERVERSERVICEUSER,
         $SQLSERVICEPASSWORD,
         $PRODUCTKEY,
         $SQLSERVERSA,
         $USERNAME,
         $PASSWD)
      Set-Location $MEDIA
      Import-Module ServerManager
      if (-not [IO.Directory]::Exists($MEDIA)){
       $hn = hostname
       return 0,"Failed to find SQL Server Installer at $MEDIA on $hn"
      $tran = ""
      Try{
       & $MEDIA\setup.exe /ACTION=$ACTION /Q /FEATURES=$FEATURES /IACCEPTSQLSERVERLICENSETERMS /UPDATEENABLED=False /INSTALLSHAREDDIR="$INSTALLDIR\Program Files\Microsoft SQL Server" /INSTALLSHAREDWOWDIR="$INSTALLDIR\Program Files
    (x86)\Microsoft SQL Server" /RSINSTALLMODE="FilesOnlyMode" /INSTANCEID="$INSTANCEID" /INSTANCENAME="$INSTANCENAME" /INSTANCEDIR="$INSTALLDIR\Program Files\Microsoft SQL Server" /ENU="True" /AGTSVCSTARTUPTYPE="Automatic"
    /SQLSVCSTARTUPTYPE="Automatic" /NPENABLED=1 /TCPENABLED=1 /RSSVCStartupType="Automatic" /ERRORREPORTING=0 /SQMREPORTING=0 /INDICATEPROGRESS /INSTALLSQLDATADIR="$SQLDATADRIVE\DATA" /SQLUSERDBDIR="$SQLDATADRIVE\DATA" /SQLUSERDBLOGDIR="$SQLLOGDRIVE\LOG"
    /ASDATADIR="$SQLDATADRIVE\OLAP\DATA" /ASLOGDIR="$SQLLOGDRIVE\OLAP\Log" \ASBACKUPDIR="$SQLDATADRIVE\OLAP\Backup" \ASTEMPDIR="$SQLDATADRIVE\OLAP\Temp" /ASCONFIGDIR="$SQLDATADRIVE\OLAP\Config" /ASCOLLATION="Latin1_General_CI_AS"
    /SQLCOLLATION="SQL_Latin1_General_CP1_CS_AS" /SQLSVCACCOUNT="$DOMAIN\$SQLSERVERSERVICEUSER" /SQLSVCPASSWORD="$SQLSERVICEPASSWORD" /AGTSVCACCOUNT="$DOMAIN\$SQLSERVERSERVICEUSER" /AGTSVCPASSWORD="$SQLSERVICEPASSWORD"
    /ASSVCACCOUNT="$DOMAIN\$SQLSERVERSERVICEUSER" /ASSVCPASSWORD="$SQLSERVICEPASSWORD" /RSSVCACCOUNT="$DOMAIN\$SQLSERVERSERVICEUSER" /RSSVCPASSWORD="$SQLSERVICEPASSWORD" /FTSVCACCOUNT="NT AUTHORITY\LOCAL SERVICE"
    /INDICATEPROGRESS > $out
      } Catch [System.Exception] {
       return 0,$_.Exception.ToString()
      if ($tran -ne ""){
       $out += $tran
      return 1,$out
    The media resides on the server that I am remoting to in powershell and the server is on the same domain. The credentials I pass are for a Domain Admin, but SQL Server fails to validate the credentials for the passed parameter for the sql service user with
    a Access Denied.
    If I run the same command with the same user directly on the server it works fine.
    My guess is that the elavated privs for Administrator are not being set when using Invoke-Command? Is there a way to utilize powershell to install SQL Server 2012 with command line option using the invoke-command and passing credentials? Or is this a limitation
    to the SQL Server installer. If there is can a example be provided?

    Ok, so with the help of some friends, we found a fix that works!
    Prior to running the Invoke-Command I now run:
    # enable CredSSP on a client computer; this command allows the client credentials to be delegated to the server01 computer.:
    Enable-WsManCredSSP -Role Client -DelefateComputer server.some.domain.com
    Then I add the -Authentication option to my Invoke-Command with option Credssp.
    The install the works fine. Hope this helpes all.

  • I have Time Machine that I used to back up my old computer. It was running snow leopard. My MacBook died, so I got a new one which is running Lion.  how can I restore the data from the time capsule to my new Mac?

    I have Time Machine that I used to back up my old computer. It was running snow leopard. My MacBook died, so I got a new one which is running Lion.  how can I restore the data from the time capsule to my new Mac?

    In technical support, sometimes you have to make educated guesses. I'm sorry that you were offended.
    iTunes does prompt when it is going to erase a device, and the message is clear.
    She said in her message that she was able to successfully sync the old ipad. This indicated to me that itunes wiping the data was not an issue, because either it had been setup at the apple store (in which case it doesn't actually wipe the ipad despite saying it will*) (*based on a single case I saw), or because the itunes media folder was migrated.
    Furthermore, my solution was to tell her how to backup her ipad (by either doing it manually, or as a last resort, by deleting the corrupt backup -- that she couldn't access anyway.)
    I got that last part of the instructions from the "Taking Control of your iphone" book which I found samples of when I did a google search for "corrupted backup itunes".
    She marked this as a solution, so it worked for her.

  • How can i make the results of dos command print to text area in a gui????

    I need to get the results from a command line application to print in a text area located in a gui... i have the following code written, which should run the command... if run from a dos window, the command prints the list of what's in a jar file to the screen.... i want that info that is printed to go in a text area which i have named textBox which is global to the program.. i know textBox.appends() is what i should use but how do i retrieve the info from the dos window to put in the appends method?
    The code is below for the method..
    Thanks,
    DH
         /*     Runs the DOS Command for listing a JAR File     */
         public void jarList ( ) // Needs To Be Fixed!!
              listFieldText = listField.getText();
              String command;      
              command = "jar tf " + listFieldText;
              System.out.println(command);
              Runtime rt = Runtime.getRuntime();
              try
                   Process child = rt.exec(command);
                   child.waitFor();
                   System.out.println("Process exit code is: " + child.exitValue());
              catch(IOException e)
                   System.err.println("IOException starting process!");
              catch(InterruptedException e)
                   System.err.println("Interrupted waiting for process!");
    }

    Replace child.waitFor()with:          BufferedReader br=new BufferedReader(new InputStreamReader(child.getInputStream()));
              String s="";
                    while((s=br.readLine())!=null) {
                        textbox.append(s);
                    }Mark

  • My partner has my former iPad 1, I have an iPhone 5 and iPad Gen III.  I want to copy my contacts list to his iPad.  We both have Apple ID's and we share a PC.  How do i copy the contacts from my iPhone, iCloud or iPad to his iPad 1?

    copy my contacts list to his iPad.  We both have Apple ID's and we share a PC.  How do i copy the contacts from my iPhone, iCloud or iPad to his iPad 1?

    The problem is that all services are bundled with your Apple ID ([email protected]):
    Your iCloud account (Mail, Contacts, Calendars, Reminders, Notes, Backups, etc.),
    also iTunes & App Store purchases (Music, Movies, TV Shows, etc.),
    and the iTunes Match services.
    (I guess that all your devices - yours and your wife's are connected to one iTunes library, right?)
    If you want that your wife gets her own iCloud account for Mail, Contacts, Calendars, etc. but gets also access to your media then you have two set up two things on her device:
    iCloud (Settings > iCloud) with her account (e.g. [email protected])
    and
    iTunes & App Stores (Settings > iTunes & App Stores) with your account (e.g. [email protected]).
    In this case she gets access to your library and could use the same iTunes Match account.
    (See also: Using one Apple ID for iCloud and a different Apple ID for Store Purchases http://support.apple.com/kb/HT4895)

  • How can I sort the words in a document into an alphabetical list?

    How can I sort the words in a document into an alphabetical list? Thanks!

    writer888 wrote:
    How can I sort the words in a document into an alphabetical list? Thanks!
    Copy the words to the Mac's clipboard (Edit menu> Copy)
    Paste into TextEdit 
    Next open the Edit > Find > Find window in Text Edit.
    Highlight a space between two words and Edit menu > copy, paste into the Find field
    Next create a return in the middle of your text and copy that and paste into the Replace field
    Click Replace All.
    Now Edit > Select All and Edit > Copy
    Open a Spreadsheet program with Sort ability and paste into the second column cell from the top
    place a "a" into the top column cell, select the entire colum
    Sort desending order
    Now if you need it out of spreadsheet format, then your going to need to copy just the data cells (not the entire column to avoid problems) and Paste "Special" as unformatted text into a word processing program
    If you need to get rid of the Returns, do the opposite you did in Text Edit, replace the Returns with Spaces
    A chore, but it's rare one needs to sort words into alaphabetical order.
    FYI, I used TextEdit and the free LibreOffice (Spreadsheet and Word Processing) for the above effects.

  • My document.numbers can not be opened how can i recover the version from yesterday i was not using time machine and it was not in icloud. is there an app i can buy that might help

    my document.numbers can not be opened how can i recover the version from yesterday? i was not using time machine and it was not in icloud. is there an app i can buy that might help

    Thanks Andy,
    I wish I could have told my sister about this as she could not open my homepage back before my new iWeb site. She now can open my site without the yet in case denial window does appear = I thank you.
    I think my iWeb site works as Noone has said otherwise from any platform etc...
    Alex L
    I do agree that should not have to be a consideration for any users so i agree that it would be great if Apple could allow simplicity to run seemlessly.
    I have had this problem since Homepage, and here is
    what has worked for me. I send out the link, and
    then for PC users I send the link with "<" after the address (without quotation
    marks. e.g., <http://site.com>).
    I also put a note that if that doesn't work, to just
    copy and paste the link into a browser. With that I
    have only had 1 person say they still can't open.
    Everyone else gets it to work.
    It's a lot to do and seems like a hassle, but you get
    used to it.
    Hope this helps!
    Andy Martini
    PS - APPLE! When are you going to fix this??! It
    seems like such a small thing yet you guys have been
    stumped for YEARS on this!

  • How Do I stop the phone from locking while the navigation program is running.

    I have a Blackberry 9630 V4.7.1.40. The phone is on an enterprise server network through work. The phone is set to password lock after a couple of min. of non-use. When I have the Sprint Navigation program running, the phone locks after a few min and loses my satellite. I then have to type in a password to unlock it and I then get the signal back.
    I called Sprint and they said to press a button after every couple of min. to keep the phone "active". That sounds a little fishy to me!
    How do I keep the phone from locking while the Nav. Application is running?
    Thank you for your help
    Bill

    brauscher wrote:
    press a button after every couple of min. to keep the phone "active". That sounds a little fishy to me!
    Agreed, that is the simplest thing to do... probably much easier than talking your IT guys into raising your timeout.
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • I have Safari on an HP desktop running Windows 7, 64-bit. When I want to clear the history from Safari, the "Reset Top Sites Also" button is always checked. This can cause problems. Any way to have it unchecked all the time?

    I have Safari on an HP desktop running Windows 7, 64-bit. When I want to clear the history from Safari, the "Reset Top Sites Also" button is always checked. This can cause problems. Any way to have it unchecked all the time?

    Welcome to the HP Forums Hinalover,
    I see by your post that you are having issues with the print spooler on the Windows 7 computers.
    I can help you with this issue.
    Download and run the Print and Scan Doctor. It will diagnose the issue and might automatically resolve it. Find and fix common printer problems using HP diagnostic tools for Windows?
    Try running the Microsoft Fix It Tool to see if it will fix the print spooler.
    Diagnose and repair Windows File and Folder Problems automatically.
    You can also run the System File Checker to repair corrupted or missing files.
    System File Checker: Run sfc /scannow & analyze its logs in Windows 7 | 8.
    You might end up having to do a repair of Windows.
    Please let me know the results.
    Have a nice day!
    Thank You.
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" on the right to say “Thanks” for helping!
    Gemini02
    I work on behalf of HP

  • I am running on OS X 10.5.8, how to I get the latest version of iCal??? I have my computer since 2009, I am running on OS X 10.5.8, how to I get the latest version of iCal??? I have my computer since 2009

    I am running on OS X 10.5.8, how to I get the latest version of iCal??? I have my computer since 2009, I am running on OS X 10.5.8, how to I get the latest version of iCal??? I have my computer since 2009

    You need to install a newer Mac OS X version to get a newer version of iCal. If you're using a PowerPC Mac, you can't upgrade the OS or iCal further.
    (60198)

Maybe you are looking for

  • ITunes crashes when I plug in my iPod 5.5G

    I recently installed OS X 10.7.2, and iTunes 10.5. Now, whenever I plug my 80GB iPod 5.5G, iTunes will, "Quit Unexpectedly". If iTunes isn't open, and I plug my iPod in and then try to open iTunes, I get the same error message before iTunes loads. It

  • U Can Avoid Most Firefox Problems By Using Version 3.6.3! =)

    Some 'mod' named 'philip' locked my prior thead, pretending that 3.6.3 is a security problem. They are lying to you. If you have any questions about how to tweak 3.6.3 for maximum performance, let me know. I can also post my personally tweaked versio

  • Landscape planning with BI and APO

    Hello all, This is more of planning question rather than issue. If you have upgraded your R/3 system first to Unicode before the BI and APO/SCM - how did you manage the interface testing within BI and APO, especially on how to avoid impact on existin

  • Short black screen before play

    When I preview my Encore bluray project and push a menu button, the screen goes black for a quarter of a second before the chosen movie begins. How can I avoid this?

  • Where can I get the password for unzipping LabVIEW DSC RTS 6.0 ?

    no additional text