Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add Clients by Line Command 3

Status
Not open for further replies.

yadnakis

MIS
Jul 19, 2005
20
EU
Hello

I want to add client by line command.

It`s possible?

Thanks

 
Run nsradmin. Then create a client like this:
nsradmin> create type: NSR client; name: abc
type: NSR client;
name: abc;
Create? y
created resource id 44.0.100.8.216.252.40.68.192.168.3.19(1)
nsradmin>

Of course you may have defined other attributes along with the command or you now can UPDATE them appropriately.
 
Use nsradmin for this, just type nsradmin to get into the prompt, then type the following wich will create a client
named "calvin" in group "Test2" with save set "All".
You can ofcourse modify all other attributes as well, same
as you can when you create a client from NW Admin.

create type:NSR client;name:calvin;group:Test2;save set:All

Or, you can script it in a batch file and add %number to allow you execute the script and sending arguments to it.
Below is a very simple example of a batch file that does this. If you call the file "test.bat" you would execute it with "test.bat client_name group_name". The %1 variable is the first argument sent, i.e client_name, and %2 is the second, i.e group_name.

@echo off
echo create type:NSR client;name:%1;group:%2;save set:All > "%CD%\test.txt"
nsradmin -i "%CD%\test.txt"
del "%CD%\test.txt"

Cheers!
Maverick
 
Sorry for the crosspost 605.. =)
yadnakis: An nice thing about running nsradmin -i inputfile is that you dont have to answer "y" to create the resource.

Cheers!
Maverick
 
hi,

if you do not want to create a file and then issue the nsradmin command, you may use this form (unix version):

# nsradmin -s nsr_server_name -i - << EOF
> create type: nsr client;
> name: nsr_client_name
> EOF

you can just add other nsr client resources that will fit your need before the EOF. this works for all other nsr resources as well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top