From: Ryan Leavengood Date: 2006-05-22T11:00:12+09:00 Subject: Re: User Account Setup - Multiple OS's On 5/20/06, Paul D. Kraus wrote: > I am learning ruby and have a background in perl. > As my first project and to help me get my head around ruby I want to create > a useradmin script that will let me do the following. > > * Remotely create a domain user on a windows 2000 server See Win32API or other windows related libraries. > * Remotely create a user on a sco openserver box > * Remotely create a directory on Linux > * remotely create a user on Linux > * remotely append to the smb.conf on Linux All the above can probably be done with Net::SSH: http://net-ssh.rubyforge.org/ > * Login into or webmail admin page and create a new email user Could be done with WWW:Mechanize (gem install mechanize) > * Remotely add mac address to a squid access list > * remotely restart squid Probably Net::SSH again. > From input(gui at a later time, from command line switches now): > user's full name > user's password > username > switch for add and a switch for remove See optparse (http://www.ruby-doc.org/stdlib/libdoc/optparse/rdoc/index.html) or cmdparse (http://cmdparse.rubyforge.org/) or commandline (gem install commandline, http://rubyforge.org/projects/optionparser/) > New to OO thinking so I am going to be fighting a desire to write this > procedurally but the idea is to have some kind of user object that would > handle all of this. I would suggest writing it procedurally if that is what you are comfortable with, and then objectifying it later. I was born and raised on OO, but with Ruby I almost always start with just coding something quick and then making objects. That is one of the benefits of Ruby: rapid prototyping. > OH yeah the script (at least how i see it) would be sitting out on a samba > share on a Linux machine but being run on the actual workstation that the > new hire will be using. This should not be a problem as long as the script looks like a file to Ruby. Ryan