Ramesh
Ramesh

Reputation: 1

how to delete a server from a profile in Websphere application from command line

I have a profile in WAS 8.5 with multiple servers (ex: have a profile with Profile1 and in that profile i have server1, server2, server3) I want to delete server1 out of three servers through command line. I do not want to delete profile. want to delete one server among all.

thanks in advance

Upvotes: 0

Views: 1990

Answers (1)

M I P
M I P

Reputation: 917

You can use the below wsadmin script (with -lang jython) to do that.

#Enter the server name. eg: servername='server1'
servername=
#Enter the node name. eg: nodename='Node1'
nodename=
#get the server id.
serverid=AdminConfig.getid('/Node:'+nodename+'/Server:'+servername)
#remove the server
AdminConfig.remove(serverid)
#save the configuration
AdminConfig.save()

Note : Ensure the JVM is stopped before running the above script.

Upvotes: 1

Related Questions