Finding User Profile path

Tim Golden mail at timgolden.me.uk
Thu Mar 29 09:50:03 CEST 2007


kyosohma at gmail.com wrote:
> Hi,
> 
> I am trying to query our domain to get a list of our users profile
> locations. I thought I might be able to use WMI, but I can't get it to
> work. 

Can you be a bit more specific: did WMI itself not work? Or the
Python WMI module? What were the problems? (All this, obviously,
if you're interested in pursuing that path).

I am using a Windows XP Pro workstation and Python 2.4 on a
> mixed environment of Debian Linux (with Samba) and Windows servers. We
> are in the process of moving the user profiles from an NT box to a
> Debian box, but due to the many different servers in the organization,
> it is a pain to keep track of which have been moved and which haven't.

Have a look at the win32net module from the pywin32
extensions, specifically functions like NetUserGetInfo
and NetUserSetInfo. You have to pick your USER_INFO a
bit (look around the MSDN pages) but I think you can do
what you're after.

TJG



More information about the Python-list mailing list