Windows


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…)

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…)

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…)

Last month I wrote a post about getting Windows system information and I mentioned in one of my comments that there was another script that did some of this as well as other stuff, but I couldn’t find it. Well, today I went digging for it and found the script I wanted. So we’re going back down the rabbit hole for some more tips and tricks for getting information about the wonderful world of Windows using Python. (more…)

Another script I had to come up with for my employer dealt with getting various bits and pieces of information about each of our user’s physical machines. We wanted to keep track of the CPU speed, hard drive sizes and the amount of RAM they had (among other things) so we would know when it was time to upgrade their computer. Gathering all the pieces from the various places on the internet was a royal pain, so to save you the trouble, I’m going to post what I found. Note that a lot of this code was taken from various recipes on ActiveState or mailing lists. Most of the following can be found almost verbatim in this recipe. (more…)

At my job, I do a fair amount of system administration scripting in Python. For example, almost all the login scripts are written in Python (with some of them ported from Kixtart). Over the years, I’ve been tasked with creating shortcuts to new applications that need to be placed on the user’s desktop or in their Start Menu or both. In this article, I will show you how to accomplish this task.

Note: This is a Windows-only article, so if you don’t use that OS, then this will probably bore you to tears. Heck, it might do that anyway! (more…)

Steve Holden gave a talk on where Python is at Friday afternoon. For those not in the know, Holden is the current chairman of the Python Software Foundation (PSF). His first topic was about the PSF and how few member it had as well as how they were planning to add additional members at this PyCon. Holden spoke on who the Python community is, what noobs think of Python when they first start using it, Python conferences, development, PSF grants, the Python website and more.
(more…)

About a week ago, I wrote that I was working on a sample application that I would be posting here. As I worked on it, I realized that I needed to figure out a way to break it up in a way that was simple, organized and generic. Thus, I decided to create a series of “how-to” articles on the bits and pieces of my application and post them here. Then I will post another article that walks through putting all the pieces together.

The pieces for this application include the following:

  • The wx.BoxSizer
  • The wx.Dialog class
  • The wx.Menu, wx.StatusBar and wx.Toolbar
  • The wx.AboutBox

Note: I already have a BoxSizer tutorial done.

I think that covers the main wxPython bits. I will also be using the standard Python 2.5 library’s email, urllib and smtplib modules as well as a few win32 specific modules. I think you will find this set of articles quite educational. Please be sure to let me know what you think.

The past couple of days, I’ve needed a way to create a shortcut on a user’s desktop during the login process. I had a way that worked for most shortcuts, but I just could not figure out how to do this one.

(more…)

One of the first scripts I had to help translate from Kixtart to Python was our map drives script. In it, we would map drives based on either which group the user was in and/or what a custom registry entry said. Here is a partial example of each of these categories in Kixtart:

IF READVALUE("HKEY_LOCAL_MACHINE\SOFTWARE\MyOrg", "Office")= "officeName"
$Drive="g:" $Path="\\serverName\" + @userid Call "@lserver\\folderName"
ENDIF
 
IF InGroup("Dept XYZ")
$Drive="g:" $Path="\\serverName\" + @userid Call "@lserver\\folderName"
ELSE
ENDIF

(more…)

« Previous PageNext Page »