Hi Matthew, I am looking out to get the OS Type for my nsh script for this i tried the above option with does not work for me can you please let me know how to use the property value to get the OS type?

first - why are you doing this ? why do you need to write the server:os to a file? what are you going to do w/ that ?

so let's fix your script snippet above:

# unless you have a top level folder in the Servers workspace named 'Server' you don't include '/Server' in the group path.

GROUP1="/mygroup"

# why are you taking OS as an argument if that's what you are trying to derrive ? so we'll take that out.

# you are not using the blcli very well here

blcli_execute Server listServersInGroup "${GROUP1}"

blcli_storeenv TOT_SRVS

# it's better habbit to use a while loop instead of a 'for' so you can handle spaces, etc.

while read server

do

# why did you comment out the uname call ?

OS="$(uname -D //${server} -s)"

echo "servername: ${server} and OS Type: ${OS}" >> "${output_file}"

# strip the trailing empty line from the list of servers

done <<< "$(awk 'NF' <<< "${TOT_SRVS}")"

matt's example is using a job to pass in the server name and the value of the server property. that works if you are running this as a nsh job. it's unclear if you are doing that or running this as a script from the command line. instead of the uname call you could also run a blcli command to get the value of 'OS'. that has the advantage of not needing nsh access to the targets. if you are running this from the command line on some workstation that may be a problem. this version of the script would look like:

GROUP1="/mygroup"

blcli_execute Server listServersInGroup "${GROUP1}"

blcli_storeenv TOT_SRVS

while read server

do

blcli_execute Server printPropertyValue ${server} "OS"

blcli_storeenv OS

echo "servername: ${server} and OS Type: ${OS}" >> "${output_file}"

done <<< "$(awk 'NF' <<< "${TOT_SRVS}")"

now, that could be slow depending if you have a lot of servers in the group. so instead you could use a bulk dump of the property value: