Scripting 101 Windows Administration - PowerPoint PPT Presentation

1 / 15
About This Presentation
Title:

Scripting 101 Windows Administration

Description:

Managing Windows with Vbscript and WMI. Don Jones. 978-0321213341 ... Advanced VBScript. Don Jones and Jeffrey Hicks. 978-0735622449. Resources. Microsoft ... – PowerPoint PPT presentation

Number of Views:87
Avg rating:3.0/5.0
Slides: 16
Provided by: windows5
Category:

less

Transcript and Presenter's Notes

Title: Scripting 101 Windows Administration


1
Scripting 101 Windows Administration
Windows Boston
Published 2008 Clyde G. Johnson,
MCSE,MCSA,MCITP, A
2
Automate repetitive Tasks
  • Login Scripts
  • UserID Creation
  • Inventory Scripts
  • Mass file changes
  • Data Migrations

3
Type it once
  • Use it many times.
  • Modular code.
  • Use lots of comments.
  • The next person to read your code might be you!!

4
Types of Admin Scripts
  • WMI (inventory)
  • ADSI (Manipulating Active Directory)
  • File manipulation
  • Registry Manipulation
  • Remote vs. local
  • logon and startup

5
Simple scripts Hello World
  • DEMO
  • Dos
  • VBS
  • VBA

6
Anatomy of a script
  • Comments!
  • Header
  • What the name should be.
  • Your name and the Date.
  • Attribution whom you borrowed it from.

7
Simple WMI Script
  • WMI comes standard preloaded and setup on Windows
    2k computers.
  • Make sure the WMI service is running.
  • Key to WMI is finding the class you want to
    query.
  • Must have admin rights on local PC or networked
    pc to get any info back.
  • Pull the Serial number with VBS
  • Do the same thing using VBA in Excel

8
Simple ADSI Script
  • Add a User using VBS
  • Released in 1997 as a set of generic interfaces
    that access and manipulate different directory
    services.
  • Admins and Developers can use ADSI to enumerate
    and managed resources in a directory service.
  • Can Read, Modify, Create and Delete domain
    objects

9
Scriptomatics
  • WMI Scriptomatic 2.0
  • ADSI Scriptomatic
  • Tweakomatic
  • Internet exploder and Windows settings

10
File Manipulation
  • Reading in
  • Writing out
  • Create \ delete folders

11
Installing programs via CMD
  • Any MSI
  • Can output a log file
  • C\config
  • C\Config\Activity log

12
Wscript and Cscript
  • WScript
  • This is what is invoked when you click on a vbs.
  • Associated with vbs in windows.
  • Cscript
  • Can be ran at the command prompt.
  • Cscript.exe c\sample.vbs
  • Microsoft tends to use it in their scripts. ie
    GPMC scripts.

13
Tools
  • Windows Script 5.6 Documentation
  • http//www.microsoft.com/downloads/details.aspx?Fa
    milyId01592C48-207D-4BE1-8A76-1C4099D7BBB9displa
    ylangen
  • Primal Script http//www.sapien.com/
  • EditPad lite by JGSOFT http//www.editpadpro.com/
    editpadlite.html

14
Books
  • Managing Windows with Vbscript and WMI
  • Don Jones
  • 978-0321213341
  • VBScript, WMI, and ADSI Unleashed
  • Don Jones
  • 978-0321501714
  • Advanced VBScript
  • Don Jones and Jeffrey Hicks
  • 978-0735622449

15
Resources
  • Microsoft Script Center
  • http//www.microsoft.com/technet/scriptcenter/defa
    ult.mspx
  • UCS Toolkit
  • http//ucstoolkit.rutgers.edu/technical/scripts.ht
    ml
  • Win32 Scripting
  • http//cwashington.netreach.net/
Write a Comment
User Comments (0)
About PowerShow.com