Forum Discussion

Black_D's avatar
Black_D
Level 2
10 years ago

Powershell script for exclude lists.

I want to create a powershell script to push  out to all clients an update to there exclude lists.

Does anyone have something like this already?

I have over a 1000 Windows clients to update an would perfer not to do them one at a time.

Thanks.

 

  • In order to process a command against a large number of clients I use an excel spreadsheet to generate the script for me.

    Say you have an exclude list called “exclude.txt”, which contains the following text.

    /usr/thing_to_exclude

    You would then run the following command to update the configuration for a host names example123.

    bpsetconfig –h example123.yourcompany.com –e exclude.txt

     

    In excel you would have your list of hosts in column "A". In column "B" you would write this

    ="bpsetconfig –h " & A1 & " –e exclude.txt"

    Then you use the copy pull in the bottom right hand corner to copy that command down the document to cover all 1000 lines or whathaveyou.

    Column B should now contain a command on each line with the name of each host from column A.

    Copy this text out in to a powershell script. Run this script from the master server. Go get a drink. Put your feet up. Tell everyone you are working really hard on this exclude list thing. It's a really big project, after all.

3 Replies

  • Sorry I forgot to say we are running Netbackup 7.1 on a Windows platform.

  • In order to process a command against a large number of clients I use an excel spreadsheet to generate the script for me.

    Say you have an exclude list called “exclude.txt”, which contains the following text.

    /usr/thing_to_exclude

    You would then run the following command to update the configuration for a host names example123.

    bpsetconfig –h example123.yourcompany.com –e exclude.txt

     

    In excel you would have your list of hosts in column "A". In column "B" you would write this

    ="bpsetconfig –h " & A1 & " –e exclude.txt"

    Then you use the copy pull in the bottom right hand corner to copy that command down the document to cover all 1000 lines or whathaveyou.

    Column B should now contain a command on each line with the name of each host from column A.

    Copy this text out in to a powershell script. Run this script from the master server. Go get a drink. Put your feet up. Tell everyone you are working really hard on this exclude list thing. It's a really big project, after all.

  • Have used a bat script based on bpplclients to find the Windows Clients and a loop with bpsetconfig for each client with the excludelist file.

    Think something like

    @clients= bpclients command

    foreach client @clients bpsetconfig command

    is what you are looking for, but probably needs a little polishing