| | | Senior Member
Join Date: Jul 2006 Location: Canada
Posts: 820
Certifications: Bachelor of Business (MIS), DIT (Networking). Certification(s): Superman. Working towards CEO. | What do you use for Windows scripting? I'm just wondering what do you guys use to write scripts in a Windows environment?
Also, what are the most common tasks that system admins accomplish through scripts?
I read about Powershell, which has been around since 2003.
__________________
Blaming tfosorciM
|
| | Login/register to remove this advertisement. | | | was here.
Join Date: Apr 2008
Posts: 3,639
| Use PowerShell. Anything else won't be as integrated or good.
Adding/deleting users. Enumerating all computers in your domain etc... |
| | | g33k
Join Date: Dec 2008 Location: On a fretboard
Posts: 1,016
Certifications: CCNA, MCSA:2003 | Quote:
Originally Posted by tiersten Use PowerShell. Anything else won't be as integrated or good.
Adding/deleting users. Enumerating all computers in your domain etc... | Agreed.
I only use vbscript for the time being since thats all I know  It gets alot done its just that Powershell can do whole lot more. These are good video tutorials. |
| | | MIPS processor please
Join Date: Feb 2007 Location: Louisville, KY
Posts: 2,108
Certifications: MCSE 2003, MCTS: Vista Configure, VCP4, Associates in Computer Network Systems | vbscript
And batch if I need something really quick and dirty. |
| | | Senior Member
Join Date: Jun 2009 Location: West Des Moines, IA
Posts: 225
Certifications: MCTS: 620, 640 | +1 for Powershell. I would also recommend downloading Powergui ( PowerGUI.org - Free Windows Powershell Community) and the QAD Active Directory Powershell cmdlets.
__________________
MCTS: Windows Vista, Configuration
MCTS: Windows WS08 Active Directory, Configuration
|
| | | Drops by now and again
Join Date: May 2008 Location: Vancouver, Canada
Posts: 3,059
Certifications: n+1 | These days for Windows scripting I use PowerShell, then PowerShell, after that I'll try it in PowerShell, next I'll take another swing at it in PowerShell, finally attempting it one more time in PowerShell, and if that doesn't work then KIXtart (nothing beats the simplicity of KIX for some tasks), and only if I absolutely have to VBscript.  |
| | | Senior Former Member
Join Date: Jan 2008
Posts: 1,980
Certifications: MCITP: EA, EMA; MCSE 2000/2003: M; MCSE 2000: S; MCSA 2000/2003: S; MCTS: ISA 2006; VCP3/4 | Quote:
Originally Posted by binarysoul I'm just wondering what do you guys use to write scripts in a Windows environment?
Also, what are the most common tasks that system admins accomplish through scripts?
I read about Powershell, which has been around since 2003. | PowerShell all the way. Things I've done with PowerShell? - Created reports from AD of all Domain Controllers, every computer without the latest service pack, all users who have expired password or haven't logged in over a certain threshold, all users who hadn't been migrated yet, etc...
- Dumped DHCP configuration of all DHCP servers in an AD forest, totaling about 50 servers
- Cleared DNS cache across 120 DNS servers
- Processed users to add/remove from groups corresponding with phases in a complex forest migration
- Check disk space on servers and NetApp volumes
- Properly deprovision user accounts according to legal compliance/company policy guidelines
- Change local admin passwords across hundreds of servers and desktops
- Change DNS conditional forwarding for certain domains across 120 DNS servers
- Change TCP/IP configurations for over 100 servers simultaneous
- Clear out unneeded snapshots on VI3/vSphere environments.
- Create vSwitches across multiple ESX servers simultaneously
I could go on and on...  |
| | | Senior Member
Join Date: Nov 2008 Location: NYC
Posts: 188
| Quote:
Originally Posted by binarysoul I'm just wondering what do you guys use to write scripts in a Windows environment?
Also, what are the most common tasks that system admins accomplish through scripts?
I read about Powershell, which has been around since 2003. | I used PrimalScript as my IDE, but in the process of moving to PowerGUI Script Editor from Quest.
I write in VBscript/WMI and making the move over to Powershell.
Some tasks I do via scripts:
-getting local admins to machines
-pulling Win32 logs
-grabbing PC info
-installing/uninstalling software
-checking GPOs
Last edited by sambuca69; 02-09-2010 at 05:15 PM.
|
| | | Nidhoggr, the Net Serpent
Join Date: Nov 2007 Location: FL
Posts: 946
Certifications: MCITP:EA,EMA,EDA MCSE:Messaging 2003, MCSE:NT4, MCTS, CCNA, EMCISA | Powershell has only been around since 2006, with Exchange 2007 being the first product that required it - even the GUI Management Console really runs PS cmdlets. With add-ons like the ADCmdlets from Quest and the new features in PS 2.0, it really is the best choice for windows scripting.
Prior to that there was VB Script, which I never bothered to learn. I have also used Wise or the SMS Installer to write compiled scripts, and before that I even used a little Kix scripting when a batch file wouldn't work. |
| | | Senior Member
Join Date: Jun 2005 Location: Massachusetts
Posts: 205
Certifications: A+, Network+, Linux+, Security+, EnCE, CCE, MCSA Server 2003, MCTS: Vista WIP: 70-432 | Quote:
Originally Posted by Claymoore Powershell has only been around since 2006, with Exchange 2007 being the first product that required it - even the GUI Management Console really runs PS cmdlets. With add-ons like the ADCmdlets from Quest and the new features in PS 2.0, it really is the best choice for windows scripting.
Prior to that there was VB Script, which I never bothered to learn. I have also used Wise or the SMS Installer to write compiled scripts, and before that I even used a little Kix scripting when a batch file wouldn't work. | Does anyone have a good recommendation for a book on Powershell? |
| | | Virtually in the shadows
Join Date: Oct 2008 Location: Peoria, IL
Posts: 140
Certifications: Security+, MCITP: Enterprise Messaging Administrator 2K7, MCSE:Security 2K3, VCP 3.5/4.0 | Scripts There are good scripts that are batch, VBscript and powershell. Powershell would be good to learn but some of us are good at VB already and now trying to learn a new language. Either one can run WMI queries as it will get you back any information you need to know on any Windows machine. Powershell can do more functions with less code but VB still does a great job of gathering information. That being said I want to know both
Learning powershell myself by watching these videos and practicing..... CBT Nuggets: On The Job Training Series: Windows PowerShell
__________________
-----------------------------------------------------
The more knowledge one obtains the more there is too accumulate.....
-------------------------------------------------------
|
| | | Senior Member
Join Date: Jun 2009 Location: West Des Moines, IA
Posts: 225
Certifications: MCTS: 620, 640 | Haven't had a chance to read it yet, but here is a free powershell pdf book: Master-PowerShell | With Dr. Tobias Weltner - PowerShell.com
__________________
MCTS: Windows Vista, Configuration
MCTS: Windows WS08 Active Directory, Configuration
|
| | | Senior Member
Join Date: Jul 2006 Location: Canada
Posts: 820
Certifications: Bachelor of Business (MIS), DIT (Networking). Certification(s): Superman. Working towards CEO. | Quote:
Originally Posted by Everlife Does anyone have a good recommendation for a book on Powershell? |
My friend, you can try this published by Microsoft Press. Direct from horse's mouth http://www.microsoft.com/learning/en...1&locale=en-us
__________________
Blaming tfosorciM
|
| | | Senior Member
Join Date: Mar 2007
Posts: 12,182
| Quote:
Originally Posted by binarysoul | Actually, that PoSh book got horrible reviews. Check out the Absolute Beginners book or other highly-reviewed books on Amazon.
__________________ ''=~('(?{'.('[-@.^~'^'+_)@*^').'"'.('@.&@-@@<@~$@^~.@^_'^')@@/^)%[%^@/*^@%*}').',$/})') |
| | | Senior Former Member
Join Date: Jan 2008
Posts: 1,980
Certifications: MCITP: EA, EMA; MCSE 2000/2003: M; MCSE 2000: S; MCSA 2000/2003: S; MCTS: ISA 2006; VCP3/4 | Quote:
Originally Posted by Everlife Does anyone have a good recommendation for a book on Powershell? | How about a free eBook? Powershell TFM V1 eBook http://www.primaltools.com/downloads/communitytools/
Best all around book IMO for learning PowerShell for admins. The Absolute Beginner one is arguably better for just learning how to script, but the book above is the best one for both the shell and scripting. Keep in mind the newer version of the book just released in eBook covers PoSh 2.0, but all the concepts of 1.0 pretty much carry over. |
| | | Senior Member
Join Date: Jun 2005 Location: Massachusetts
Posts: 205
Certifications: A+, Network+, Linux+, Security+, EnCE, CCE, MCSA Server 2003, MCTS: Vista WIP: 70-432 | Thanks guys, I'll give them a look! |
| | | Drops by now and again
Join Date: May 2008 Location: Vancouver, Canada
Posts: 3,059
Certifications: n+1 | My vote for the 1st PoSh book everyone should pickup is Amazon.com: Windows Powershell in Action (9781932394900): Bruce G. Payette: Books
Read it cover to cover and practice as you go, it jumps around but if you follow it through you'll realize the things you were shown were at the right times. Jump around and you'll just get confused.
You can pickup what's new in 2.0 when you need to, after all you've got a lot to learn.  |
| | | g33k
Join Date: Dec 2008 Location: On a fretboard
Posts: 1,016
Certifications: CCNA, MCSA:2003 | I've never used the netsh command. Put this together in just a few minutes. Code: @echo off
netsh diag show computer
netsh diag show ip
netsh diag show dhcp
netsh diag show dns
netsh diag show gateway
netsh diag show ieproxy
netsh diag ping dhcp
netsh diag ping dns
netsh diag ping gateway
netsh diag ping ieproxy
netsh diag ping iphost 172.18.80.250
cmd /K
|
| | | Senior Member
Join Date: Nov 2006 Location: United Kingdom
Posts: 1,442
Certifications: MCSA 2003, JNCIA-FWV, Security+ Expired: CCNA | Powershell
Basic PC audit for a group of pc's
Search through a bunch of files on a select group of pc's for text patterns and make changes based on the results
VBScript
Interesting one in vbscript, had a FSA requirement come through to lock out PC's at a particular time in the evening (yeh financial traders do not like locking or turning off their pc's at all).
Basic stuff like enumerating AD user accounts to the domain with random generated passwords etc.
Batch
Using dnscmd tool to add multiple forwarders to the DNS servers as well as deleting a few.
__________________
Cobra's! Let's bounce!
2010-2011 Goals: Get MCITP:EA done. Maybe VCP and CEH.
Next up: 11th October 70-648 MCSA transition Exam - 80% revision done.
|
| | | Senior Former Member
Join Date: Jan 2008
Posts: 1,980
Certifications: MCITP: EA, EMA; MCSE 2000/2003: M; MCSE 2000: S; MCSA 2000/2003: S; MCTS: ISA 2006; VCP3/4 | Don't forget you can use PowerShell in combination with batch and vbscript. For example, I added conditional forwarders to DNS servers using PowerShell to get all the DC's in the forest which were also all the DNS servers, then used a foreach-object loop to launch the dnscmd command string that added the conditional forwarding. |
| | | Senior Member
Join Date: Nov 2006 Location: United Kingdom
Posts: 1,442
Certifications: MCSA 2003, JNCIA-FWV, Security+ Expired: CCNA | Quote:
Originally Posted by HeroPsycho Don't forget you can use PowerShell in combination with batch and vbscript. For example, I added conditional forwarders to DNS servers using PowerShell to get all the DC's in the forest which were also all the DNS servers, then used a foreach-object loop to launch the dnscmd command string that added the conditional forwarding. | That sounds more logical, just giving examples of scripting ive used based on skillset and when I did them kind of thing. They all have uses, I mean batch is still very usable for deployment server scripting (eg. Altiris).
__________________
Cobra's! Let's bounce!
2010-2011 Goals: Get MCITP:EA done. Maybe VCP and CEH.
Next up: 11th October 70-648 MCSA transition Exam - 80% revision done.
|
| |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | All times are GMT. The time now is 07:00 AM. | |