Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


wanna be sold on powershell...

 
Logged in as: Guest
arrSession:exec spGetSession 2,5,40520
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> Windows PowerShell >> wanna be sold on powershell...
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 wanna be sold on powershell... - 12/6/2006 10:43:58 AM   
  edavis6678

 

Posts: 121
Score: 0
Joined: 1/12/2006
Status: offline
anyone have good compelling reasons why?

Sure, WMI is easier, but I already know it in Wsh5.6...um...ya..eventually I guess I'll learn it, but really, maybe I shoudl ask....

Why did you start developing in it?

(I'm on the fence but the time sink to learn new code i'm dreading....I need to be pushed over  :)   )

THoughts anyone?
 
 
Post #: 1
 
 RE: wanna be sold on powershell... - 12/6/2006 3:12:50 PM   
  SAPIENScripter


Posts: 270
Score: 2
Joined: 11/1/2006
From: SAPIEN Technologies
Status: offline
Probably the most compelling reason is that Microsoft management will be based on PowerShell going forward. Even if you don't want to use it for scripting, using PowerShell as a real management shell is worth the price of admission.  The other main advantage is that it is based on .NET which makes everything an object.  Once you start working with PowerShell you'll quickly realize why this is a big deal. You can take the results of one cmdlet and pipe it to another and then another until you get the information or result you want.

PowerShell is much more secure by design and out-of-the-box.

VBScript and batch files don't have to be replaced.  If they work and get the job done there's no reason to re-invent them.  PowerShell is just another tool in your administration and scripting toolkit. It isn't the right solution for every admin or scripting need and certainly has areas where it could be improved and expanded. Still, you should look through the PowerShell documentation.  Look at the PowerShell blogs. Take it for a spin.

That's my two cents.

_____________________________

Jeffery Hicks
Windows PowerShell MVP
SAPIEN Technologies - Scripting, Simplified. www.SAPIEN.com

Follow Me: http://www.twitter.com/JeffHicks

(in reply to edavis6678)
 
 
Post #: 2
 
 RE: wanna be sold on powershell... - 1/7/2007 10:11:34 AM   
  dm_4ever


Posts: 2313
Score: 34
Joined: 6/29/2006
From: Orange County, California
Status: offline
I want to be sold too.  I wonder what type of tasks people are using PowerShell for. No code is necessary, but I'd like to know how they're leveraging its potential.  WMI being simpler to query maybe be a welcome feature for those who never bothered using it, but not necessarily for those who have.  I found an example in this forum where they did something like this:

$pc=[wmi]"root\cimv2:win32_computersystem.name='GODOT'"
$pc.totalphysicalmemory
$pc.roles

That's not too different than if I did it like this:
Set objPC = GetObject("winmgmts:Win32_ComputerSystem.Name='ComputerName'")
WScript.Echo objPC.totalphysicalmemory
WScript.Echo Join(objPC.Roles, VbCrLf)

Some say it is easy to learn, but it seems those who find it easy are those with a .NET or C# background.  In a way it's like you have to learn more than one language if you want to fully take advantage of powershell.  You need to learn it's syntax and how it works and then the .NET Framework.  I'm going to continue playing with it and trying to learn it simply because we really have no choice "going forward" as SapienScripter stated with Microsoft's Products.  I wonder how MS will implement this on a Enterprise level when each person could have their own profile with certain cmdlets, aliases, etc?

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to SAPIENScripter)
 
 
Post #: 3
 
 RE: wanna be sold on powershell... - 1/8/2007 12:26:00 AM   
  SAPIENScripter


Posts: 270
Score: 2
Joined: 11/1/2006
From: SAPIEN Technologies
Status: offline
I don't think it's a matter of "selling" anyone on PowerShell.  As you use it, you'll realize where it fits in your organization.  It won't replace VBScript, WMI, ADSI, or even batch files for a long time. It is simply another tool that might work better for you.  For example, it is much easier to work with a local registry in PowerShell since it can be explored and treated as a drive. It does me very little when dealing with remote registries but if I'm on the server in PowerShell, I can do a lot very quickly.

As far as it's use in the entrerprise, already there are plenty of free enhancements and cmdlets from the PowerShell Community Extensions and others.  I think SAPIEN will even be offering some free cmdlets. Plus there are third party cmdlets such as PowerGadgets that provide graphs, dials and charts on top of PowerShell.  I did a few blog entries last month that showed how to use PowerShell to generate a file aging report and then extend it's functionality with PowerGadgets (http://sapien.eponym.com/blog/Scripting/WindowsPowerShell/_archives/2006/12).

Every user can have their own profile with customized functions, aliases and snappins.  In the short term, this might lead to so confusion when sharing scripts and code, but over time admins will develop a process.

Again, the biggest shift is from text-based processing to object based, which until you see for yourself is hard to appreciate.

So, if you have absolutely no VBScript experience, I'd start looking at PowerShell as my primary automation tool.  Realizing you may need to "backfill" with a little VBScript.  If you are already using VBScript, continue to use it where it works.  This is true even for batch files.  However, if you are feeling your scripts or batch files could do more or you were going to rework them anyway, take a look at PowerShell and see what functionality it offers that you can take advantage of.  Finally, keep an eye to the PowerShell blogs.  Maybe even pick up a PowerShell book (or two).  The more you learn about what PowerShell can and can't do, the better positioned you'll be.

_____________________________

Jeffery Hicks
Windows PowerShell MVP
SAPIEN Technologies - Scripting, Simplified. www.SAPIEN.com

Follow Me: http://www.twitter.com/JeffHicks

(in reply to dm_4ever)
 
 
Post #: 4
 
 RE: wanna be sold on powershell... - 1/14/2007 11:59:07 PM   
  gdewrance


Posts: 587
Score: 3
Joined: 3/16/2006
Status: offline
I would like to know.
How would you write a script using PowerShell. e.g can it map drives printers based on user or group
What would it's file extension be, and will it run the same as a logon script through GPO.
And can you run it against Windows 2000 or XP machines.
I know it loads on XP but then would that mean manually rolling it out to all XP machines?

(in reply to SAPIENScripter)
 
 
Post #: 5
 
 RE: wanna be sold on powershell... - 1/16/2007 3:40:54 AM   
  SAPIENScripter


Posts: 270
Score: 2
Joined: 11/1/2006
From: SAPIEN Technologies
Status: offline
You wouldn't write a logon script in PowerShell.  That's not what it is designed for.  Things like VBScript and batch files still are needed for that sort of thing. PowerShell is a management shell that lets you write scripts.  On a simple level, it is a step up from the old CMD shell.  Whereas CMD was all text based, PowerShell is object-oriented based on .NET. In CMD you could put your commands together in a batch file.  In PowerShell, you do the same thing.  The file extension is .ps1.

PowerShell will only run Windows XP and later.  I don't believe MS every intends it to run on Windows 2000.

You use PowerShell to manage things like services, processes, file systems,registry, certificate stores and more. You can use the Get-WMIObject to access WMI locally and remotely.  Right now PowerShell has limited AD management capabilities and other than Get-WMIObject, not too much with connecting to remote systems.  But I expect that to change over time.

Any system you want to run PowerShell scripts will need .NET Framework 2.0 and PowerShell.  There is supposed to be an MSI for PowerShell so you can deploy with Group Policy or SMS.  There are also Group Policy settings to control PowerShell configuration such as script execution policy.

I think the more you use Powershell, the more you'll realize where it fits into your overall management strategy.

_____________________________

Jeffery Hicks
Windows PowerShell MVP
SAPIEN Technologies - Scripting, Simplified. www.SAPIEN.com

Follow Me: http://www.twitter.com/JeffHicks

(in reply to gdewrance)
 
 
Post #: 6
 
 RE: wanna be sold on powershell... - 1/16/2007 4:35:32 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
quote:

You wouldn't write a logon script in PowerShell.  That's not what it is designed for


Why not? Disregarding whether or not AD presently supports running .ps1 files at logon, what is inherent to Powershell that makes it inappropriate for logon scripting?

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to SAPIENScripter)
 
 
Post #: 7
 
 RE: wanna be sold on powershell... - 1/16/2007 7:34:28 AM   
  SAPIENScripter


Posts: 270
Score: 2
Joined: 11/1/2006
From: SAPIEN Technologies
Status: offline
For starters, Powershell lacks native means to map drives and printers.  You can use New-PSDrive, but it won't be persistant and available outside of Powershell.  You could use net use or the VBScript network object, but then why bother with PowerShell?  I'm not saying it is impossible, just that I wouldn't spend any energy when batch and VBScript more than fill the need.  Personally, this comes back to the right tool for the job and PowerShell is not the right tool for most user logon scripts.

If there is some Powershell feature that you think would make a killer logon script I'd love to hear it.

_____________________________

Jeffery Hicks
Windows PowerShell MVP
SAPIEN Technologies - Scripting, Simplified. www.SAPIEN.com

Follow Me: http://www.twitter.com/JeffHicks

(in reply to ebgreen)
 
 
Post #: 8
 
 RE: wanna be sold on powershell... - 1/16/2007 8:30:20 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
I agree that right now vbscript/batch is better. Our logon scripts are linked very closely to AD (for better or worse). So when the changes to give powershell better access to AD go through I would think that in and of itself would make it apealing here. Or to use your own terms:

"PowerShell is a management shell that lets you write scripts"

At my work, logon scripts are management scripts.

"On a simple level, it is a step up from the old CMD shell"

Since batch files are essentially sequential CMD shell commands, then wouldn't that make powershell a step up from batch files regardless of the application to which the script is being applied?

"Microsoft management will be based on PowerShell going forward"

Again, I see logon scripts as Management tools.

So, I could easily support trhe assertion that powershell may not currently be the best tool for logon scripting, but your statement made it seem as though it would be patently wrong to even consider it. I won't be changing any of my logon scripts to powershell any time soon, but that is primarily due to a lack of availability on the client machines. In a year or two when we have universal powershell availablity and presumably the AD support and perhaps drive mapping support is better I will certainly consider it. In the meantime, I will conduct all of my powershell research with that possibility in the back of my mind and I would not want to preclude others from doing the same by flat out saying that it's just not something you would do.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to SAPIENScripter)
 
 
Post #: 9
 
 RE: wanna be sold on powershell... - 1/16/2007 8:51:49 AM   
  SAPIENScripter


Posts: 270
Score: 2
Joined: 11/1/2006
From: SAPIEN Technologies
Status: offline
I don't think I said I'd never use PowerShell for a logon script. If I did, you're right, that is an extreme position. I think we're in agreement that right now PowerShell is the wrong tool for logon scripts. At least as most people use logon scripts.  Some people use logon scripts to map drives and printers and that's it.  Others, like you it sounds like, take logon scripts as far as you can, and run all sorts of other other code under the user's credentials.  Certainly some of that functionality might be available or even better in Powershell, in which case once you get past the technical deployment issues, PowerShell could be an attractive tool.

Many of my other comments were attempts to answer some of the other questions about what PowerShell is and to provide some comparative context.

In the same way that VBScript has eventually replaced batch files for logon scripts and other automation needs over time, I expect the same thing to happen with PowerShell eventually.  But think about how long it took to make the transitiion from batch to VBScript.  I doubt the VBScript to PowerShell transistion will be as long but my guess is this won't be widespread until Windows 2000 goes the way of Windows 98.

_____________________________

Jeffery Hicks
Windows PowerShell MVP
SAPIEN Technologies - Scripting, Simplified. www.SAPIEN.com

Follow Me: http://www.twitter.com/JeffHicks

(in reply to ebgreen)
 
 
Post #: 10
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> Windows PowerShell >> wanna be sold on powershell... Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts