Re: Newbie needs Help Please

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



On Wed, 13 Sep 2006 10:25:05 -0500, McKirahan <News@xxxxxxxxxxxxx> wrote:

<zylinius1983@xxxxxxxxx> wrote in message
news:1158157786.913726.95600@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hello,

I have decided I need to learn how to script very badly. I have been
hired as the network administrator at a quickly growing company. I
want to right a script for adding our new hires, since this is going to
be a common proccess. I need to Add a user. create an email account.
add the user to a group. create a "home directory" that thier My
Documents points to on the server, A profile, grant access to our
sharepoint portal, grant access to Customer Service email accounts.
Can I do all this with one script? I would hate to miss a step, and
have problems when a large group of new hires start. Thanks for the
help

Hopefully, you mean
"I have decided I very badly need to learn how to script."
not
"I have decided I need to learn how to script very badly."
:)


And in the event that he ment the latter, here are some helpful tips:

* The first line in your script should always be "On Error Resume Next",
and never "Option Explicit".
* Name variables and functions after things on your desk.
* Remember that you can re-use the names of built-in functions when
writing your own improved versions
* Never use local variables; I for one don't trust things that cease to
exist when you stop observing them.
* Never return values from functions; it's redundant if you're following
the previous guideline.
* Never use function arguments; they are local variables in disguise.
* Take a page from Java and make a class for everything, including
primitive types.
* Never write comments unless they either repeat what the code says, or
contradict what the code says.
* Never name a temporary counter "i" or "j" or "count".
* Eval is your friend.
* Redim Preserve is slow, so just Dim arrays with the largest dimensions
you figure you'll need. 100 is a good starting point for most things.
* All your assumptions about caller are correct. Validating input is a
waste of time.
* Strategically ignore all of these guidelines here and there to throw
people off.

--
Justin Piper
Bizco Technologies
http://www.bizco.com/
.



Relevant Pages

  • Re: doubt in a script
    ... :>>> I have a doubt in one of the script i use, i want to know what the ... portability concern should be to other ksh's, ... The Bourne shell is virtually extinct and ash ... Besides, it does so much more than creating local variables, it ...
    (comp.unix.shell)
  • Re: calculate the difference between timestamps
    ... Or is it for me & you to don't loose ... Using function arguments as local variables is good practice, ... zA-Z] matches any single letter, ... In Thomas' script [. ...
    (comp.lang.awk)
  • script USE help
    ... @dbname varchar; ... Our GUI installation modifies the value of this script. ... Exiting database ... I am guessing that you cannot use local variables in a USE command. ...
    (microsoft.public.sqlserver.server)
  • local variables and fileevent script
    ... I'm developping an application that makes use of the fileevent command to keep the GUI alive during long calculations. ... What I'm looking for is a way to "pass" the value of local variables to the script fileevent will execute once the channel gets readable/wirtable. ... Both solutions I could think of don't really statisfy me: global variables or enclose the script in "" instead of ...
    (comp.lang.tcl)
  • Re: iptables -> refuse/grant access from ips in a file
    ... >> to let entire subnets in or out. ... >> a user and FileA.txt to grant access to a subnet. ... > If you need to alter this on a running machine, you might make your script ... > daemon to continuously monitor file changes. ...
    (linux.redhat.misc)