I did alot of perl programming in university, and I have fond memories of it.

I am currently writing a perl script to create personal settings for users that use manditory profiles. As in, when they log on all open office settings / firefox settings and other application settings are set on the fly using perl.

But in order to correctly setup the profile I need to know the groups a user is in. I havent come across any code that does this, is it possible in perl?

I recommend you search CPAN for the Win32 modules and search through them and see if there is one that provides this function. I don't know off the top of me head if there is one or not. -------------------------------------------------

1) If i do the AdUser->new as specified, i get: Can't locate object method "new" via package "AdUser" (perhaps you forgot to load "AdUser"?) when I try to run the script and 2) When I go Win32::AD::User::new (instead of AdUser->new) i get this error: Win32::AD::User -- Warning USER_REFERENCE_STRING not defined.

Although Im not sure whether what I have written in the USER_REFERENCE_STRING is correct, it is most definately defined.

If this all proves too much effort i'll probably just write my own routines to do what I want, but I would much prefer it if i did not have to do that.

The code you posted should not even complie since @groups has not been declared with "my". But I will assume your script does include that. The code you posted looks OK to me from what I can tell by looking at the modules documentation. I don't know what an LDAP connection string looks like so I assume what you posted is correct and that "username" is the name of a real user. -------------------------------------------------