Results 1 to 5 of 5

Thread: zmprov setAccountCos with exception

  1. #1
    Join Date
    Sep 2011
    Posts
    39
    Rep Power
    4

    Default zmprov setAccountCos with exception

    Hi there,

    I'm wondering if an exclude for some accounts in my script it's possible or not please ?
    I want all the users of the domain "domain.ltd" to get a new CoS except some of them

    Thanks for your help

    Code:
    #!/bin/bash
    
    domain=domain.ltd
    cosname=CoS1
    
    for account in `zmprov -l gaa domain.ltd
    
    do
    
    zmprov setAccountCos ${account} $cosname
    
    done

  2. #2
    Join Date
    Jul 2007
    Location
    Baltimore
    Posts
    1,649
    Rep Power
    11

    Default

    how are the users that should be excluded identified?

  3. #3
    Join Date
    Sep 2011
    Posts
    39
    Rep Power
    4

  4. #4
    Join Date
    Jul 2007
    Location
    Baltimore
    Posts
    1,649
    Rep Power
    11

    Default

    put them all in a file called like exclusions, then modify your script to be like this

    Code:
    #!/bin/bash
    
    domain=domain.ltd
    cosname=CoS1
    
    for account in `zmprov -l gaa domain.ltd
    
    do
    
    if grep -Fxqi ${account} exclusions 
    then
    echo "Skipping ${account}..."
    else
    zmprov setAccountCos ${account} $cosname
    fi
    done
    (Disclaimer: code not tested, but its something like that)
    Last edited by bdial; 08-14-2012 at 08:07 AM. Reason: oops, first example would run it IF they were in the file

  5. #5
    Join Date
    Sep 2011
    Posts
    39
    Rep Power
    4

    Default

    Thank you for your help bdial

Similar Threads

  1. Replies: 0
    Last Post: 01-23-2012, 10:47 AM
  2. Replies: 1
    Last Post: 12-04-2007, 05:06 PM
  3. SOAP request for SetAccountCOS?
    By cr@in-tuition.net in forum Developers
    Replies: 1
    Last Post: 02-27-2007, 01:15 PM
  4. zmtrainsa exception
    By ldotc in forum Administrators
    Replies: 9
    Last Post: 05-21-2006, 07:32 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •