Before starting this task, the wsadmin tool must be running. See the Starting the wsadmin scripting client article for more information.
Perform the following steps to disable the name server component of a configured server. You can modify this example to disable a different component.
set nameServer [$AdminConfig list NameServer $server]
nameServer = AdminConfig.list('NameServer', server) print nameServer
Example output:
(cells/mycell/nodes/mynode/servers/server1|server.xml#NameServer_1)
set components [$AdminConfig list Component $server]
components = AdminConfig.list('Component', server) print components
The components variable contains a list of components. Example output:
(cells/mycell/nodes/mynode/servers/server1|server.xml#ApplicationServer_1) (cells/mycell/nodes/mynode/servers/server1|server.xml#EJBContainer_1) (cells/mycell/nodes/mynode/servers/server1|server.xml#NameServer_1) (cells/mycell/nodes/mynode/servers/server1|server.xml#WebContainer_1)
Since the name server component is the third element in the list, retrieve this element by using index 2.
set nameServer [lindex $components 2]
# get line separator import java lineSeparator = java.lang.System.getProperty('line.separator') arrayComponents = components.split(lineSeparator) nameServer = arrayComponents[2] print nameServer
Example output:
(cells/mycell/nodes/mynode/servers/server1|server.xml#NameServer_1)
$AdminConfig modify $nameServer {{stateManagement {{initialState STOP}}}}
AdminConfig.modify(nameServer, [['stateManagement', [['initialState', 'STOP']]]])
Related concepts
AdminConfig object for scripted administration
Related reference
Commands for the AdminConfig object