I am putting in a new filer to replace three Windows servers and in the process I will have to create approx 110 shares. I have heard that there is a way of scripting the process. does anyone have any information that they could provide for me on this process?
Sláinte,
David
"Build a man a fire he'll be warm for a day, set a man on fire and he'll be warm for the rest of his life" - Terry Pratchett
Checkout my photos - http://www.panoramio.com/user/1113507
If the shares you want to create are for each user home directory then, yes, there's an automated way to do it in Data ONTAP called the cifs.homedir feature.
Basically you give the controller a set of paths where the homedirs live. The paths should contain directories that match the username of the user. Then, when the feature is activated a share of the name of the user will automatically be made available when that user connects to the storage via CIFS.
So, for example. User 'bob' connects via CIFS, say by using \netapp file:///\\netapp (where netapp is the name of the controller). Along with any other shares manually created there will be an extra share called 'bob' as well and that share will automatically point to a directory called ' bob' in one of the defined paths. Consequently when user 'mary' connects, she will see a share called 'mary', but not a share called 'bob'.
Is that what you are trying to do?
-- Adam Fox
Systems Engineer
adamfox@netapp.com
From: David McWilliams [mailto:davidkmcw@gmail.com] Sent: Monday, January 18, 2010 3:41 PM To: NetApp list Subject: NetApp scripting question
I am putting in a new filer to replace three Windows servers and in the process I will have to create approx 110 shares. I have heard that there is a way of scripting the process. does anyone have any information that they could provide for me on this process?
Sláinte,
David
"Build a man a fire he'll be warm for a day, set a man on fire and he'll be warm for the rest of his life" - Terry Pratchett
Checkout my photos - http://www.panoramio.com/user/1113507
I think the easiest is to use the CLI to create the share. Get the syntax and then create a file that has the commands that you want to use and paste it in the cli...make sure you use spaces where necessary.
On Mon, Jan 18, 2010 at 3:40 PM, David McWilliams davidkmcw@gmail.com wrote:
I am putting in a new filer to replace three Windows servers and in the process I will have to create approx 110 shares. I have heard that there is a way of scripting the process. does anyone have any information that they could provide for me on this process?
Sláinte,
David
"Build a man a fire he'll be warm for a day, set a man on fire and he'll be warm for the rest of his life" - Terry Pratchett
Checkout my photos - http://www.panoramio.com/user/1113507
"plink", part of the putty suite allows you to send commands via ssh, which you can easily wrap in your scripting language of choice, and can either have it save credentials or use PKI keys.
-- Sent from my mobile device
On Jan 18, 2010, at 5:45 PM, Jack Lyons jack1729@gmail.com wrote:
I think the easiest is to use the CLI to create the share. Get the syntax and then create a file that has the commands that you want to use and paste it in the cli...make sure you use spaces where necessary.
On Mon, Jan 18, 2010 at 3:40 PM, David McWilliams davidkmcw@gmail.com wrote:
I am putting in a new filer to replace three Windows servers and in the process I will have to create approx 110 shares. I have heard that there is a way of scripting the process. does anyone have any information that they could provide for me on this process?
Sláinte,
David
"Build a man a fire he'll be warm for a day, set a man on fire and he'll be warm for the rest of his life" - Terry Pratchett
Checkout my photos - http://www.panoramio.com/user/1113507
Do this from the cmd prompt from a windows box: (I assume you have view admin rights to the shares)
net view \<server name>
copy the share names to a text file.
then, I use a rsh from an XP or box that has rsh enabled.
You can use an excel file with all the shares and volumes, or use a script.
rsh to your filer with the output rsh <filername> cifs shares -add <name of share> /vol/volume_for_your_share/
I have a script that calls a text file of all the shares with variables,,, Its not really sexy but gets it done. I can send to you if you wish. I created one from about 50 shares. It took about 1 minute to do it all... LOVE MY FILERS!!
You can do the same for qtrees.
David McWilliams wrote:
I am putting in a new filer to replace three Windows servers and in the process I will have to create approx 110 shares. I have heard that there is a way of scripting the process. does anyone have any information that they could provide for me on this process?
Sláinte,
David
"Build a man a fire he'll be warm for a day, set a man on fire and he'll be warm for the rest of his life" - Terry Pratchett
Checkout my photos - http://www.panoramio.com/user/1113507
Another tip...or way to do this...
get all your commands in order. Place them in a text file. Place the text file on your netapp and then:
source /vol/path/to/file
The filer will execute all the commands in the file. --tmac Tim McCarthy Principal Consultant
On Mon, Jan 18, 2010 at 11:48 PM, steve klise klises@caminomedical.org wrote:
Do this from the cmd prompt from a windows box: (I assume you have view admin rights to the shares)
net view \<server name>
copy the share names to a text file.
then, I use a rsh from an XP or box that has rsh enabled.
You can use an excel file with all the shares and volumes, or use a script.
rsh to your filer with the output rsh <filername> cifs shares -add <name of share> /vol/volume_for_your_share/
I have a script that calls a text file of all the shares with variables,,, Its not really sexy but gets it done. I can send to you if you wish. I created one from about 50 shares. It took about 1 minute to do it all... LOVE MY FILERS!!
You can do the same for qtrees.
David McWilliams wrote:
I am putting in a new filer to replace three Windows servers and in the process I will have to create approx 110 shares. I have heard that there is a way of scripting the process. does anyone have any information that they could provide for me on this process?
Sláinte,
David
"Build a man a fire he'll be warm for a day, set a man on fire and he'll be warm for the rest of his life" - Terry Pratchett
Checkout my photos - http://www.panoramio.com/user/1113507
-- View this message in context: http://old.nabble.com/NetApp-scripting-question-tp27216749p27220950.html Sent from the Network Appliance - Toasters mailing list archive at Nabble.com.
On Mon, Jan 18, 2010 at 8:48 PM, steve klise klises@caminomedical.orgwrote:
--snip-- rsh to your filer with the output rsh <filername> cifs shares -add <name of share> /vol/volume_for_your_share/ --snip--
I would be very, very careful with using rsh. It's very insecure. ssh via either the standard unix ssh command, or plink, can be used as a drop in replacement, and is much, much more secure.
ssh authorized_keys (passwordless ssh): http://ww w.nabble.com/ssh-config-on-DOT-7-t2595957.htmlhttp://www.nabble.com/ssh-config-on-DOT-7-t2595957.html ssh inline replacement of rsh on a unix host: http://www.didc. lbl.gov/DPSS/ssh-info.html http://www.didc.lbl.gov/DPSS/ssh-info.html
If you *do* have to use rsh, be sure to use role based access controls to create a user, and a role w/ minimum number of commands needed.
Hey Steve,
On Tue, Jan 19, 2010 at 05:48, steve klise klises@caminomedical.org wrote:
net view \<server name>
....
rsh <filername> cifs shares -add <name of share> /vol/volume_for_your_share/
Be aware that you will not be copying any permissions set on the share level in this way. If you have share-level permissions, you can set them using the "cifs access" command.
This example hands out Full Control to the domain users group:
plink -ssh root@toaser 'cifs access myshare "CORP\Domain Users" Full Control'
Good luck with the scripting!
On Mon, Jan 18, 2010 at 12:40 PM, David McWilliams davidkmcw@gmail.comwrote:
I am putting in a new filer to replace three Windows servers and in the process I will have to create approx 110 shares.
May I know why you need to create 110 shares? How are you organizing your data from the three windows servers? I would look at creating *a share per volume* and organize the data within Qtrees under each of these volumes and look at using Microsoft DFS to present the data in a more user friendly way.
-G
I am putting in a new filer to replace three Windows servers and in the process I will have to create approx 110 shares. I have heard that there is a way of scripting the process. does anyone have any information that they could provide for me on this process?
It's easy, but like any scripting task, you just need to know what you want ahead of time. If these shares are of the most basic sort (share name, path, everyone/full control access), then all you need to do is dump all the commands into a file and execute them on the filer or via SSH. If you can handle a reboot, just append all of the new shares into <root>/etc/cifsconfig_share.cfg. The syntax is straightforward, and the shares will be created upon next boot. I suspect the same would happen if you just restarted CIFS, but I haven't tried it. Take a look at it - it's simple - and you can just as easily set different access to each share if you have that information too.
*------------------------------------------*-----------------------* | Kevin Davis (UNIX/Storage Sysadmin) | Natick, Massachusetts | | 508.647.7660 | 01760-2098 | | mailto:kevin.davis@mathworks.com *-----------------------* | http://www.mathworks.com | | *------------------------------------------*-----------------------*