The other day, there was a post on one of the mailing lists that I follow about accessing the Windows Event Logs. I thought that was an interesting topic, so I went looking for examples and found a pretty nice example on ActiveState. In this article, you’ll find out what I discovered. (more…)
Entries tagged with “System Admin”.
Tue 27 Jul 2010
PyWin32: Getting Windows Event Logs
Posted by Mike under Python, System Administration, Windows
View Comments
Sat 5 Jun 2010
Python: Running Ping, Traceroute and More
Posted by Mike under Python, System Administration, wxPython
View Comments
Last year I needed to figure out a way to get the following information with Python: get the route table, capture the data from pinging a series of IPs, run tracert and get information about the NIC(s) installed. This all needed to be done on a Windows machine as it was part of a diagnostics script to try to figure out why the machine (usually a laptop) wouldn’t connect to our VPN. I ended up creating a wxPython GUI to make it easy for the user to run, but these scripts will work just fine without wx. Let’s see what they look like! (more…)
Sat 27 Mar 2010
Restarting PCs with Python
Posted by Mike under System Administration, Windows, wxPython
View Comments
Have you ever wanted to restart your Windows PC with out pressing Start, Shutdown or CTRL+ALT+DEL? What about restarting your annoying co-worker’s PC…the one who just doesn’t know when to shut up? Well, Python has the answer and this blog will tell you how to do it! (more…)
Sat 20 Mar 2010
Python’s _winreg: Editing the Windows Registry
Posted by Mike under Python, System Administration, Windows
View Comments
Python’s standard library is known for including lots of handy modules and packages that can be used without installing anything else. That’s one of the primary reasons that its standard library is called “batteries included” so often. So it should come as no surprise that Python includes a Windows only module for editing the Windows Registry. This particular module goes by the odd name of _winreg (odd because it starts with an underscore). In this article, we’ll learn the basics of working with the Registry using this “battery”. (more…)
Fri 5 Mar 2010
Python: Finding the Commit Charge Values in Windows
Posted by Mike under Python, Windows
View Comments
This week I was tasked with trying to find a way to find out what the Peak Commit value was on our virtual workstations. The reason being that we are trying to save money and were wondering if we were allocating too much memory or not. We didn’t need the Total Commit Charge or the Limit Commit Charge values, but since I figured out how to get those during my research, I’ll show how to get those as well. (more…)
Thu 25 Feb 2010
Creating Windows Shortcuts with Python (Part II)
Posted by Mike under PyWin32, Python, System Administration
View Comments
Back when I first wrote about creating shortcuts with Python last month, I kept thinking to myself that I had a 3rd way of doing it. Today, I had to maintain some of my shortcut code and I stumbled upon it once more. I also noticed that my post had received a comment from Tim Golden on yet another way to create shortcuts, so I’ll include that in this post as well. (more…)
Sun 14 Feb 2010
Python, Windows and Printers
Posted by Mike under Python, System Administration, Windows
View Comments
I do a fair amount of technical support in addition to my software development. In our small shop, we get to troubleshoot anything that is related to technology, from networks to software to printers. I think one of the most annoying aspects is trying to get printers to work the way the user wants. Another issue is setting up printers for users that have to roam from PC to PC as a part of their job. These users usually only need the printers that are in their specific location at any given time. It’s very difficult to accommodate this type of user, especially if the PCs are being used 24/7, which is true in my case. This is where Python comes in. (more…)
Tue 9 Feb 2010
Using Python to Reduce the Roaming Profile
Posted by Mike under Python, System Administration, Windows
View Comments
Roaming Profiles are a blessing and a curse. If the user uses the internet, their browser’s cached files will grow like mad. If the user downloads programs to their desktop or creates large Powerpoint files anywhere in their profile, then they have to be managed whenever the user logs in or out. There are several solutions to this problem: disk quotas, blocking the ability to download or put stuff in one’s profile, etc. In this article, I will show you how to exclude specific directories from the user’s profile using Python. (more…)
Tue 9 Feb 2010
Enabling Screen Locking with Python
Posted by Mike under Python, System Administration, Windows
View Comments
A few months ago, my employer needed to lock down some of our workstations to be compliant with some new software we were installing from another government organization. We needed to force those machines to lock after so many minutes elapsed and we needed to make it such that the user could not change those settings. In this article, you’ll find out how do this and as a bonus, I’ll also show you how to lock your Windows machine on demand with Python. (more…)
Sat 6 Feb 2010
Lock Down Windows with Python
Posted by Mike under Python, System Administration, Windows
View Comments
Almost four years ago, I was tasked with converting a Kixtart script to Python. This particular script was used to lock down Windows XP machines so they could be used as kiosks. Obviously, you don’t need Python to do this. Any programming language that can access the Windows Registry will be able to do this or you could just use Group Policies. But this is a Python blog, so that’s what you’re going to get in this article! (more…)