Win32 Perl Scripting: Administrator's Handbook
You can purchase this online from Amazon.com
All administrators need tools to correctly perform their job. These tools can range from books and programs to programming languages. For a network administrator, one of the greatest tools is a good scripting language.
Depending on whom you ask, the preferred scripting language of choice differs. Some like Java and some like Visual Basic. Others prefer Rexx and yet others use Python. Then there is the ubiquitous Perl language, the king of scripting languages. Perl is a jack-of-all-trade language. It can be used to perform almost any possible task. It is easy to learn and fun to use. Perl brings a network administrator not only a tool, but an entire toolset.
Win32 administrators, however, are usually not familiar with Perl. This unfamiliarity could be because Perl originated in the UNIX world. Or it could be that Microsoft promotes Visual Basic as the scripting language of choice for Win32 machines. This is too bad because Perl will quickly become a Win32 system administrator's best friend.
Generally speaking, Win32 administrators focus on looking for full-blown solutions to problems. They like to buy some off-the-shelf software that is designed to perform some administrative task. It is quite easy to install some software package and have it automatically solve some problem. However, this approach becomes costly as the number of problems increases.
Solving problems with Perl, however, is cheap--especially when you consider that one script can be adapted to fix other problems. Not only is this a reasonable way to solve problems, but it is also the foundation for automating your network.
Every network administrator will, at one point, be inundated with work. Likewise, every administrator will have to quickly solve emergencies. And while both of these things are happening to the administrator, new issues will arise that feed back into this cycle. At that point, a server will go down and chaos will break loose. This result is typical and should be expected.
But these situations are manageable. Fires can be extinguished, and problems can be rectified. The only serious problem is that doing so takes time. Usually, an administrator's time is so taken up with the chaos of daily problems that there is never time to consider how to solve major problems and issues. This is where scripting comes in.
When an administrator leverages the power of a good scripting language, processes can be automated. This means that daily reports can be generated, servers can be monitored, and routine maintenance can be automated. Implementing such activities can be the stepping stone to achieving a better-implemented network.
When I was a network administrator for the State of Michigan, I automated almost every possible aspect of my job. Every day, log files were created on my servers, and Web pages were generated by automatically merging data from databases into template files. I found that by creating automated processes, I was able to perform my daily tasks in one-fourth of the time it took my peers in other departments. This free time I could spend solving bigger problems and implementing solutions that no one else had time for.
Back to the top
The goal of this book is not to attempt to teach you how to run a Win32 network. Enough books are available to do that. Instead, this book will introduce different techniques for monitoring events, quickly resolving problems and proactively preparing for inevitable catastrophes. You should read these chapters if you're looking for techniques to simplify your work. Tasks such as discovering which users are disabled or locked out of their accounts (Chapter 2) or killing a process on a remote machine (chapter 9)--these are tasks that are of benefit to any administrator.
The goal of this book is not to attempt to teach you how to run a Win32 network. Enough books are available to do that. Instead, this book will introduce different techniques for monitoring events, quickly resolving problems and proactively preparing for inevitable catastrophes.
You should read these chapters if you're looking for techniques to simplify your work. Tasks such as discovering which users are disabled or locked out of their accounts (Chapter 2) or killing a process on a remote machine (chapter 9)--these are tasks that are of benefit to any administrator.
This book is defined into 9 different chapters. Each one focusing on a different topic.
Chapter 1: Perl and the Admin This chapter discusses the various aspects of what an administrator needs to know when introducing the Perl language to a network. This is a good place to start for those who have never played with Perl. And for those well seasoned Perl guru’s you may find some interesting Win32 specific tricks to help make the best use of Perl on Windows 2000, NT, ME, 98 and 95. Chapter 2: Account Maintenance The purpose of this chapter is to break free of the GUI application bonds that Win32 administrators have found themselves bound to. Here you will discover scripts that will allow you to manage you Win32 accounts from a command line without ever having to lift the mouse. These scripts also provide an effective way to automate account maintenance. Chapter 3: Tools What administrator would be caught dead without the proper tool? Unfortunately most Win32 administrators, that’s who. Not that it is anyone’s fault but there is a definite lack of affordable utilities that can solve tasks. In this chapter you can find tools that are more than just handy; they can be used in everyday use. Tools for discovering shared directories (including hidden shares), discovering NTFS alternate data streams, discovering file information, reading permissions, setting the owner on files and Registry keys and setting a machine to automatically logon a particular user. Chapter 4: Crisis Management Every network goes through some sort of crisis. Some more than others. In this chapter you will learn some simple and effective techniques to prepare for the inevitable. How to recover COM based documents, forcing users to disconnect from a shared resource and backing up and restoring user accounts, file permissions and network shares are just a few of the topics covered. Chapter 5: Monitoring and Reporting Just how does an administrator go about preemptively addressing problems? The answer is pretty simple: by pro-actively monitoring networked machines. Sure, this is easy to say, but just how do you do it? Chapter 5 discusses the various aspects of monitoring the Win32 events such as the event log. Once events have been monitored they need to be reported so that your administration team can respond to it. Various reporting methods are discussed, ranging from sending out network messages and emails to paging. Chapter 6: Logon Scripts Logon scripts are those little programs that run when a user logs into a domain. They are usually overlooked but they can be used to update user’s files and reconnect to network resources. What’s even more interesting is how you can leverage these scripts to perform routine maintenance and even perform new computer configurations. Chapter 7: Processes Creating and managing processes are not as straight forward as they were under UNIX. Not only does Win32 Perl inherit all of it’s UNIX-like process creating functionality but it adds some Win32 specific ones as well. And mixing these flavors can cause some painful programming. This chapter discusses which functions should be avoided and which other ones should be promoted. Here you will discover how to use Perl to discover examine the list of processes and how to go about killing individual tasks. Chapter 8: Win32 Services UNIX administrators call them daemons and Win32 administrators call them services. Either way they both refer to a program that runs on its own. Yes, Win32 Perl scripts can be run as a service, but it is not as simple as you may think. This chapter discusses techniques to run Perl scripts as services. Chapter 9: ADSI and WMI The two acronyms that can cause even the most seasoned Win32 administrator to panic are ADSI and WMI. These are two fairly new technologies that provide an incredible wealth of information and control. Every administrator will eventually have to face these technologies. This chapter exposes them by describing what they are and how they work.
This chapter discusses the various aspects of what an administrator needs to know when introducing the Perl language to a network. This is a good place to start for those who have never played with Perl. And for those well seasoned Perl guru’s you may find some interesting Win32 specific tricks to help make the best use of Perl on Windows 2000, NT, ME, 98 and 95.
The purpose of this chapter is to break free of the GUI application bonds that Win32 administrators have found themselves bound to. Here you will discover scripts that will allow you to manage you Win32 accounts from a command line without ever having to lift the mouse. These scripts also provide an effective way to automate account maintenance.
What administrator would be caught dead without the proper tool? Unfortunately most Win32 administrators, that’s who. Not that it is anyone’s fault but there is a definite lack of affordable utilities that can solve tasks. In this chapter you can find tools that are more than just handy; they can be used in everyday use. Tools for discovering shared directories (including hidden shares), discovering NTFS alternate data streams, discovering file information, reading permissions, setting the owner on files and Registry keys and setting a machine to automatically logon a particular user.
What administrator would be caught dead without the proper tool? Unfortunately most Win32 administrators, that’s who. Not that it is anyone’s fault but there is a definite lack of affordable utilities that can solve tasks.
In this chapter you can find tools that are more than just handy; they can be used in everyday use. Tools for discovering shared directories (including hidden shares), discovering NTFS alternate data streams, discovering file information, reading permissions, setting the owner on files and Registry keys and setting a machine to automatically logon a particular user.
Every network goes through some sort of crisis. Some more than others. In this chapter you will learn some simple and effective techniques to prepare for the inevitable. How to recover COM based documents, forcing users to disconnect from a shared resource and backing up and restoring user accounts, file permissions and network shares are just a few of the topics covered.
Just how does an administrator go about preemptively addressing problems? The answer is pretty simple: by pro-actively monitoring networked machines. Sure, this is easy to say, but just how do you do it? Chapter 5 discusses the various aspects of monitoring the Win32 events such as the event log. Once events have been monitored they need to be reported so that your administration team can respond to it. Various reporting methods are discussed, ranging from sending out network messages and emails to paging.
Just how does an administrator go about preemptively addressing problems? The answer is pretty simple: by pro-actively monitoring networked machines. Sure, this is easy to say, but just how do you do it? Chapter 5 discusses the various aspects of monitoring the Win32 events such as the event log.
Once events have been monitored they need to be reported so that your administration team can respond to it. Various reporting methods are discussed, ranging from sending out network messages and emails to paging.
Logon scripts are those little programs that run when a user logs into a domain. They are usually overlooked but they can be used to update user’s files and reconnect to network resources. What’s even more interesting is how you can leverage these scripts to perform routine maintenance and even perform new computer configurations.
Creating and managing processes are not as straight forward as they were under UNIX. Not only does Win32 Perl inherit all of it’s UNIX-like process creating functionality but it adds some Win32 specific ones as well. And mixing these flavors can cause some painful programming. This chapter discusses which functions should be avoided and which other ones should be promoted. Here you will discover how to use Perl to discover examine the list of processes and how to go about killing individual tasks.
Creating and managing processes are not as straight forward as they were under UNIX. Not only does Win32 Perl inherit all of it’s UNIX-like process creating functionality but it adds some Win32 specific ones as well. And mixing these flavors can cause some painful programming. This chapter discusses which functions should be avoided and which other ones should be promoted.
Here you will discover how to use Perl to discover examine the list of processes and how to go about killing individual tasks.
UNIX administrators call them daemons and Win32 administrators call them services. Either way they both refer to a program that runs on its own. Yes, Win32 Perl scripts can be run as a service, but it is not as simple as you may think. This chapter discusses techniques to run Perl scripts as services.
The two acronyms that can cause even the most seasoned Win32 administrator to panic are ADSI and WMI. These are two fairly new technologies that provide an incredible wealth of information and control. Every administrator will eventually have to face these technologies. This chapter exposes them by describing what they are and how they work.
Let's face it, Win32 machines are not simple, nor are they simple to manage. Creating a new user account and making the user's home directory and then applying correct permissions can be quite tedious. This book assumes that you understand these concepts of administering a network. It simply provides a series of tools that allow you to perform your job quickly and more efficiently.
Enjoy the read.