ALERT: Some images may not load properly within the Knowledge Base Article. If you see a broken image, please right-click and select 'Open image in a new tab'. We apologize for this inconvenience.

Script to show which group a User is located in within Spectrum?

book

Article ID: 213187

calendar_today

Updated On:

Products

CA Spectrum

Issue/Introduction

It doesn't look like there is an attribute on a User Model that shows which group the User Group they are located in. Is there a script we can run to see this information via CLI?

Environment

Release : 20.2.x

Component : Spectrum Core / SpectroSERVER

Resolution

Below is a script that will return this value. A .sh file will need to be created in the <SPECROOT>/vnmsh directory.

#!/bin/sh
echo " 
  CA Incorporated
  One CA Plaza
  Islandia, NY 11749
 
  Copyright (c) 2017 CA, Inc.
  All rights reserved.
 
  IN NO EVENT SHALL CA INCORPORATED BE LIABLE FOR
  ANY INCIDENTAL, INDIRECT, SPECIAL, OR CONSEQUENTIAL DAMAGES
  WHATSOEVER (INCLUDING BUT NOT LIMITED TO LOST PROFITS) ARISING OUT
  OF OR RELATED TO THIS SOFTWARE, EVEN IF CA INCORPORATED HAS BEEN
  ADVISED OF, KNOWN, OR SHOULD HAVE KNOWN, THE POSSIBILITY OF SUCH
  DAMAGES.
 
"
CLISESSID=$$
export CLISESSID 
CLIPATH=/usr/Spectrum/vnmsh
$CLIPATH/connect
for a in `./show models | grep -i username | awk '{ print $1 }'`
do
./show associations mh=$a | grep -i Has_Member
done
$CLIPATH/disconnect

 

NOTE: In the above, you will need to change the CLIPATH variable to the path of the <SPECROOT> directory. Also, you will need to edit the 'username' to the user you want to search for each time its run.