ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl-win32-admin
perl-win32-admin
RE: Has anyone already invented the wheel....
by Gary MacDonald other posts by this author
Apr 20 2001 7:22PM messages near this date
view in the new Beta List Site
Win32::NetAdmin::UserGetAttributes fails on Win 2000 | RE: Has anyone already invented the wheel....
I apologize for the second post, but Outlook mangled one of the statements
in the script.  Here's a replacement that Outlook should leave alone:
 
    push @resources, "\x2F\x2F$server/$share-> {netname}";  # optional:
replace \x2F with /
 
Gary
     
 -----Original Message-----
From: Gary MacDonald [mailto:gary.macdonald@[...].ca]
Sent: Friday, April 20, 2001 4:43 PM
To: 'Bateman, John [Austin-IS)'; Active State (E-mail)
Subject: RE: Has anyone already invented the wheel....



This should get you started ...
 
use strict;
use File::Find;
use Time::Local;
use Win32::Lanman;
#
my $time = timelocal(59,59,23,31,11,98); # Dec 31, 1998, 23:59:59
my @servers = qw(server1 server2 server3);
my @resources;
#
foreach my $server (@servers)
{
        my @shares;
        Win32::Lanman::NetShareEnum ("\\\\$server", \@shares);
        foreach my $share (@shares)
        {
                next unless $share-> {type} == -2147483648;
                next if $share-> {netname} eq 'ADMIN$';
                push @resources, " {"> file://$server/$share-
<file://$server/$share->  >{netname}";
        }
}
print "$_\n" foreach @resources;
#
find (\&wanted, @resources);
#
sub wanted
{
        return if -d; # comment if directories are wanted too
        my $modtime = (stat($_))[9];
        return if $modtime >  $time;
        print "$File::Find::name -->  ", scalar localtime($modtime), "\n";
}
 
 
Gary W. MacDonald

-----Original Message-----
From: Bateman, John [Austin-IS) [mailto:JBateman@[...].com]
Sent: Friday, April 20, 2001 2:23 PM
To: Active State (E-mail)
Subject: Has anyone already invented the wheel....



Good Afternoon, 
        I am looking for the quickest/fastest/best way to write a script
that will search all hard drives on multiple servers, looking for all
files/directories with date stamps prior to 1999 (Some of these files may be
Mac files Stored on NT servers). Does anyone have some code that they could
share?  I am not the worlds greatest perl programmer but love the language.

Thank You all very much, 
John 
Attachments:
unknown1


Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved