I am Microsoft Systems administrator, would like to learn how to script,
which scripting language would you recommend for scripting in an Active
directory environment ?

thank you

Re: Want to learn scripting.... by James

James
Sat Mar 01 19:43:38 CST 2008

"rob davis" <robdavis@discussions.microsoft.com> wrote in message
news:17B8E752-016E-4438-9871-77DE8F2E59A2@microsoft.com...
>I am Microsoft Systems administrator, would like to learn how to script,
> which scripting language would you recommend for scripting in an Active
> directory environment ?

I personally think these are two good books to consider:

Managing Enterprise Systems with the Windows Script Host
http://amazon.com/Managing-Enterprise-Systems-Windows-Script/dp/1893115674

Windows Script Host by Tim Hill
http://www.amazon.com/Windows-Script-Host-Circle-Timothy/dp/1578701392



Re: Want to learn scripting.... by robdavis

robdavis
Sat Mar 01 19:50:01 CST 2008

Thank you....

"James Whitlow" wrote:

> "rob davis" <robdavis@discussions.microsoft.com> wrote in message
> news:17B8E752-016E-4438-9871-77DE8F2E59A2@microsoft.com...
> >I am Microsoft Systems administrator, would like to learn how to script,
> > which scripting language would you recommend for scripting in an Active
> > directory environment ?
>
> I personally think these are two good books to consider:
>
> Managing Enterprise Systems with the Windows Script Host
> http://amazon.com/Managing-Enterprise-Systems-Windows-Script/dp/1893115674
>
> Windows Script Host by Tim Hill
> http://www.amazon.com/Windows-Script-Host-Circle-Timothy/dp/1578701392
>
>
>

Re: Want to learn scripting.... by Mark

Mark
Sun Mar 02 00:49:51 CST 2008

On Sat, 01 Mar 2008 16:21:01 -0800, rob davis wrote:

> I am Microsoft Systems administrator, would like to learn how to script,
> which scripting language would you recommend for scripting in an Active
> directory environment ?
>

Sure, this is a VBScript group and you're still open to other
languages? VBScript is a candidate language and its interpreter is built
in since Win98. However, for purposes of scripting _all_ features of
Windows, like ADSI, VBScript offers _no_ advantages over other
interpreters, only disadvantages.

From my experience, Perl and Python (P&P) are the top choices. Ruby may be
catching up for all I know -- it is strong on Open Source platforms.
VBScript is basically unchanged and stale since Win2k, while P&P are
still actively being improved. P&P can be downloaded and installed in
minutes thanks to support on Windows from www.activestate.com

Any subsystem of Windows is normally scripted via COM and WMI. P&P have
any and all hooks into COM that you need.

Did you know that MS used Python for Xbox? Open an XBox install in Windows
explorer and snoop around with an editor. The majority of hacks will be
Python, not VBScript.

Perl's strength is data structures, CPAN for modules, and classes/OO.
Python's strength is classes/OO, WinAPI support, and strong data
structures. VBScript's data structures are pathetic. Collections are no
substitute for associative arrays or Perl's hash.

If all we had on Windows was VBScript, it would be a life saver for time.
Fortunately, there's plenty better than it.

--
Mark

Re: Want to learn scripting.... by Wiseman82

Wiseman82
Sun Mar 02 07:36:01 CST 2008

Windows 2000 Scripting Guide is also quite good (Available free online):

http://www.microsoft.com/technet/scriptcenter/guide/default.mspx?mfr=true

Also, be sure to use my website for script examples. :-)

http://www.wisesoft.co.uk


"James Whitlow" wrote:

> "rob davis" <robdavis@discussions.microsoft.com> wrote in message
> news:17B8E752-016E-4438-9871-77DE8F2E59A2@microsoft.com...
> >I am Microsoft Systems administrator, would like to learn how to script,
> > which scripting language would you recommend for scripting in an Active
> > directory environment ?
>
> I personally think these are two good books to consider:
>
> Managing Enterprise Systems with the Windows Script Host
> http://amazon.com/Managing-Enterprise-Systems-Windows-Script/dp/1893115674
>
> Windows Script Host by Tim Hill
> http://www.amazon.com/Windows-Script-Host-Circle-Timothy/dp/1578701392
>
>
>

Re: Want to learn scripting.... by mayayana

mayayana
Sun Mar 02 08:37:19 CST 2008

> Any subsystem of Windows is normally scripted via COM and WMI.

Yes, so the language is secondary in that sense.

> VBScript's data structures are pathetic. Collections are no
> substitute for associative arrays or Perl's hash.

Isn't a Dictionary similar? Actually I rarely even use
Dictionaries myself. And they can be replaced without
much trouble by an array class if necessary.

I don't want to start a languages bake-off, but I always
find it odd when people support one language over another
so adamantly.
To my mind, being comfortable with the syntax is very
important. In that regard, I think of Perl as something only
a mathematician could love. I used to have an acquaintance
who was very big on Perl, and I've seen how amazingly efficient
it can be, but I just don't like the terseness of it. Same thing
with javascript/C++. I think case-sensistivity is idotic at
best. And superfluous semi-colons only invite mistakes.
... And while we're at it, how did OO get an unquestioned
position of status? So many people talk about OO as though
it were self-evidently superior. Personally I find the extreme
OO design of Java and .Net to be boring and artless.

But that's all just my opinion. :)





Re: Want to learn scripting.... by Don

Don
Sun Mar 02 12:53:23 CST 2008

you might as well go straight to powershell.

--
Hope it Helps.

dw

-------------------------------------------------------
Don Wilwol
www.atthedatacenter.com


"rob davis" <robdavis@discussions.microsoft.com> wrote in message
news:17B8E752-016E-4438-9871-77DE8F2E59A2@microsoft.com...
>I am Microsoft Systems administrator, would like to learn how to script,
> which scripting language would you recommend for scripting in an Active
> directory environment ?
>
> thank you



Re: Want to learn scripting.... by Corey

Corey
Mon Mar 03 07:18:46 CST 2008

Powershell is good for somethings. But consider this:

1. You must have powershell installed in order to use it. (it will
be deployed automatically soon)
2. The language it uses is a bit more difficult to grasp than
vbscript, or atleast it seems that way to me.
3. You are limited to the abilities that powershell has built in.
vbscript can use any type library that's installed on a system.


I think powershell will have it's uses. But to me, it seems like a
more powerful command line tool for batch file users. My
recommendation is to stick with vbscript.

-Corey Thomas
MCSE/MCSA/MCDBA


On Mar 2, 1:53 pm, "Don Wilwol" <donwilwol(remove)@yahoo.com> wrote:
> you might as well go straight to powershell.
>
> --
> Hope it Helps.
>
> dw
>
> -------------------------------------------------------
> Don Wilwolwww.atthedatacenter.com
>
> "rob davis" <robda...@discussions.microsoft.com> wrote in message
>
> news:17B8E752-016E-4438-9871-77DE8F2E59A2@microsoft.com...
>
> >I am Microsoft Systems administrator, would like to learn how to script,
> > which scripting language would you recommend for scripting in an Active
> > directory environment ?
>
> > thank you




Re: Want to learn scripting.... by urkec

urkec
Mon Mar 03 10:19:04 CST 2008

"Corey Thomas" wrote:

> Powershell is good for somethings. But consider this:
>
> 1. You must have powershell installed in order to use it. (it will
> be deployed automatically soon)
> 2. The language it uses is a bit more difficult to grasp than
> vbscript, or atleast it seems that way to me.
> 3. You are limited to the abilities that powershell has built in.
> vbscript can use any type library that's installed on a system.
>

With PowerShell you can acces COM objects using New-Object -Comobject... You
can also acces .Net framework classes. I think that learning PowerShell
without learning at least something about the framework doesn't make much
sense.

>
> I think powershell will have it's uses. But to me, it seems like a
> more powerful command line tool for batch file users. My
> recommendation is to stick with vbscript.
>
> -Corey Thomas
> MCSE/MCSA/MCDBA
>
>

--
urkec

Re: Want to learn scripting.... by ekkehard

ekkehard
Tue Mar 04 04:58:04 CST 2008

urkec schrieb:
> "Corey Thomas" wrote:
>
>> Powershell is good for somethings. But consider this:
>>
>> 1. You must have powershell installed in order to use it. (it will
>> be deployed automatically soon)
>> 2. The language it uses is a bit more difficult to grasp than
>> vbscript, or atleast it seems that way to me.
>> 3. You are limited to the abilities that powershell has built in.
>> vbscript can use any type library that's installed on a system.
>>
>
> With PowerShell you can acces COM objects using New-Object -Comobject... You
> can also acces .Net framework classes. I think that learning PowerShell
> without learning at least something about the framework doesn't make much
> sense.
>
>> I think powershell will have it's uses. But to me, it seems like a
>> more powerful command line tool for batch file users. My
>> recommendation is to stick with vbscript.
>>
>> -Corey Thomas
>> MCSE/MCSA/MCDBA
>>
>>
Do you think that this:

(1) To use Powershell you must
- install it
- learn a new (type of) language
- learn about the .NET framework to use new features you
can't use with VBScript

(2) The C# compiler comes with the .NET runtime; a very good IDE
is free (Express edition)

(3) While neither C# nor VB.NET are as 'simple' as VBScript, at least
they are similiar

(4) So if you are starting sysadmin programming right now, use
C# (or VB.NET)

is a valid argument? (I'm not sure, because I'm a programer, not
a sysadmin.)



Re: Want to learn scripting.... by Alex

Alex
Tue Mar 04 09:17:39 CST 2008

I've been out of the loop in VBScript/PowerShell newsgroups for over a
year, but there are some quick comments I want to make based on my beta
experience and real use over the last few years. I just wanted to remark on
some of your points from an admin perspective. Also crossing post to the
PowerShell newsgroup. :)

"ekkehard.horner" <ekkehard.horner@arcor.de> wrote in message
news:47cd2b3d$0$25514$9b4e6d93@newsspool1.arcor-online.net...

> Do you think that this:
>
> (1) To use Powershell you must
> - install it
> - learn a new (type of) language
> - learn about the .NET framework to use new features you
> can't use with VBScript

For scripting, it's definitely a new language with its own syntax (albeit
somewhat similar to Perl). However, since it is primarily a shell, you can
freely use it with existing WSH scripts and any other tools you have
(including older console applications and those built for .NET).

> (2) The C# compiler comes with the .NET runtime; a very good IDE
> is free (Express edition)
>
> (3) While neither C# nor VB.NET are as 'simple' as VBScript, at least
> they are similiar

The free C# compiler is a definite plus. I wouldn't say that it's similar to
VBScript, however. Even VB.NET is dramatically different in its behaviors
(and requires the same .NET learning curve as any other approach).

> (4) So if you are starting sysadmin programming right now, use
> C# (or VB.NET)
>
> is a valid argument? (I'm not sure, because I'm a programer, not
> a sysadmin.)

For actual _programming_, I can see a reason to pick up C#. For typical
admin use, however, the critical point that makes PS so valuable is that it
is a _shell_ first and foremost. The standard administrative approach to
solving a problem is rapidly trying to solve the problem interactively,
figuring out what's going on on-the-fly, then repeating it a lot of times.
Generally speaking, I've found that with PowerShell I can quickly solve
specific problems. In the same timeframe I'd only have a WSH script
prototyped, and I probably wouldn't even be to the first C# compilation
attempt.

This does NOT eliminate WSH/VBScript; if anyone doubts that, take a look at
techniques such as those demonstrated by Bruce Payette in PowerShell in
Action for invoking Active Scripting languages on the fly. The same thing
goes for C#; half the beta period was focused on providing a good
programming framework that makes PowerShell an attractive foundation for
.NET code designed to solve admin problems. The real truth of the matter is
that all 3 tools - WSH, PowerShell, and .NET - are designed to solve
slightly different problems. For that reason, they each have a role. For
administrative task-solving, however, I'd say that PowerShell is the
front-line tool in the forseeable future.



Re: Want to learn scripting.... by urkec

urkec
Tue Mar 04 09:25:01 CST 2008

"ekkehard.horner" wrote:

> urkec schrieb:
> > "Corey Thomas" wrote:
> >


> >> 3. You are limited to the abilities that powershell has built in.
> >> vbscript can use any type library that's installed on a system.
> >>
> >
> > With PowerShell you can acces COM objects using New-Object -Comobject... You
> > can also acces .Net framework classes. I think that learning PowerShell
> > without learning at least something about the framework doesn't make much
> > sense.
> >
> >>

> Do you think that this:
>
> (1) To use Powershell you must
> - install it
> - learn a new (type of) language
> - learn about the .NET framework to use new features you
> can't use with VBScript
>
> (2) The C# compiler comes with the .NET runtime; a very good IDE
> is free (Express edition)
>
> (3) While neither C# nor VB.NET are as 'simple' as VBScript, at least
> they are similiar
>
> (4) So if you are starting sysadmin programming right now, use
> C# (or VB.NET)
>
> is a valid argument? (I'm not sure, because I'm a programer, not
> a sysadmin.)
>
>
>

You can use whatever you like. The fact is that you can access COM objects
from PowerShell, which makes the third point of C. Thomas not valid.

--
urkec

Re: Want to learn scripting.... by ekkehard

ekkehard
Wed Mar 05 05:26:10 CST 2008

Alex K. Angelopoulos schrieb:
[...]
> "ekkehard.horner" <ekkehard.horner@arcor.de> wrote in message
> news:47cd2b3d$0$25514$9b4e6d93@newsspool1.arcor-online.net...
[...]
Arguments about "Using C# or Powershell for system administration tasks"
[...]
> For actual _programming_, I can see a reason to pick up C#. For typical
> admin use, however, the critical point that makes PS so valuable is that
> it is a _shell_ first and foremost. The standard administrative approach
> to solving a problem is rapidly trying to solve the problem
> interactively, figuring out what's going on on-the-fly, then repeating
> it a lot of times. Generally speaking, I've found that with PowerShell I
> can quickly solve specific problems. In the same timeframe I'd only have
> a WSH script prototyped, and I probably wouldn't even be to the first C#
> compilation attempt.
[...]
Thanks for your thoughts. I think your last (cited) argument is conclusive.

Re: Want to learn scripting.... by CoreyThomasMCSEMCSAMCDBA

CoreyThomasMCSEMCSAMCDBA
Fri Mar 07 16:50:01 CST 2008

I stand corrected on the COM ability of PowerShell. However, I do stand by
my comments that VBscript is better for more programmatic solutions and
PowerShell is good for more task oriented solutions.



"urkec" wrote:

> "ekkehard.horner" wrote:
>
> > urkec schrieb:
> > > "Corey Thomas" wrote:
> > >
>
>
> > >> 3. You are limited to the abilities that powershell has built in.
> > >> vbscript can use any type library that's installed on a system.
> > >>
> > >
> > > With PowerShell you can acces COM objects using New-Object -Comobject... You
> > > can also acces .Net framework classes. I think that learning PowerShell
> > > without learning at least something about the framework doesn't make much
> > > sense.
> > >
> > >>
>
> > Do you think that this:
> >
> > (1) To use Powershell you must
> > - install it
> > - learn a new (type of) language
> > - learn about the .NET framework to use new features you
> > can't use with VBScript
> >
> > (2) The C# compiler comes with the .NET runtime; a very good IDE
> > is free (Express edition)
> >
> > (3) While neither C# nor VB.NET are as 'simple' as VBScript, at least
> > they are similiar
> >
> > (4) So if you are starting sysadmin programming right now, use
> > C# (or VB.NET)
> >
> > is a valid argument? (I'm not sure, because I'm a programer, not
> > a sysadmin.)
> >
> >
> >
>
> You can use whatever you like. The fact is that you can access COM objects
> from PowerShell, which makes the third point of C. Thomas not valid.
>
> --
> urkec