Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Users home drives

by blackadder (Hermit)
on Jun 24, 2003 at 21:16 UTC ( [id://268682]=perlquestion: print w/replies, xml ) Need Help??

blackadder has asked for the wisdom of the Perl Monks concerning the following question:

O' holy ones,
Forgive my sins, I am a bit rusty and I am trying to get up to scratch....I have a list of user account names or IDs in a Windows environment, How can I obtain their individual assigned home drives as specified in their profiles. Which would be the best Win32 based library or command should I use?. Any Perls of wisdoms (and/or an example) are highly appreciated.
Yours clueless Blackadder

Replies are listed 'Best First'.
Re: Users home drives
by BrowserUk (Patriarch) on Jun 24, 2003 at 21:59 UTC

    Win32:NetAdmin UserGet/SetAttributes.


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller


Re: Users home drives
by Jenda (Abbot) on Jun 24, 2003 at 23:00 UTC

    Win32::Lanman should give you all you need and more.

    Jenda
    Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
       -- Rick Osborne

    Edit by castaway: Closed small tag in signature

Re: Users home drives
by young_david (Friar) on Jun 24, 2003 at 22:04 UTC
    Perl maintains environment variables in a special hash named `%ENV'.
    Try typing "perldoc env" to get more info.

    I'm not sure how it would be done for a list of account names from the server side, but you could
    access local environment variables on each workstation by using %ENV.
    use strict; my $profile = $ENV{'USERPROFILE'}; print $profile, "\n"; # $profile contains the path to the user's profi +le # usually located in C:\Documents and Settings\u +ser
    I'm sure some of the more experienced Monks will be able to
    give more advice on this, but I hope this helps.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://268682]
Approved by CukiMnstr
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2024-03-29 09:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found