RE: Exchange Mailbox Size

2002-01-08 Thread Gary MacDonald
Title: RE: Exchange Mailbox Size Since you mention Exchange Administrator, I'm assuming these are Exchange 5.5 servers. It is possible to walk through every message and every folder in an Exchange server to total the message sizes using Win32::OLE and CDO, but it takes an awful long time. W

product version

2001-12-13 Thread Gary MacDonald
Title: product version Why don't you post a working sample of your code, so that we can see whether your problem is replicable. Gary -Original Message- From: Sibi John [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 13, 2001 3:22 PM To: Perl (E-mail) Subject: (no subject)

RE: alternative to cmd.exe

2001-12-12 Thread Gary MacDonald
Title: RE: alternative to cmd.exe I presume what you mean is that the functions such as system, exec, and backticks invoke CMD.EXE instead of 4NT.EXE.  The documentation for the system function (see perldoc -f system) implies that the shell invoked by system is hardcoded. Here's a little s

RE: File I/O Question

2001-12-11 Thread Gary MacDonald
Title: RE: File I/O Question Without knowing the exact composition of your input file, it's difficult to infer what you're trying to accomplish. But, there's at least one obvious problem.  Try replacing     while () {         $sBody .= ;     } (which appears to be appendi

RE: Question

2001-12-07 Thread Gary MacDonald
Title: RE: Question Win32::Message -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 06, 2001 2:18 AM To: [EMAIL PROTECTED] Subject: Question Hi all, could you give me a hint to simulate the net send command thanks __

RE: Parsing pids from drwtsn.log

2001-12-03 Thread Gary MacDonald
order outside of the while loop.   Gary   -Original Message-From: Nikko Odiseos [mailto:[EMAIL PROTECTED]] Sent: Monday, December 03, 2001 12:25 PMTo: Gary MacDonald; [EMAIL PROTECTED]Subject: RE: Parsing pids from drwtsn.log Thanks Gary, but that is only half the battle.

RE: Parsing pids from drwtsn.log

2001-12-03 Thread Gary MacDonald
Title: Message I've removed the unnecessary foreach loop and the $line variable.  I'm assuming that 2152 OUTLOOK.exe is at the beginning of a line.   The trick is to use the capturing capability of the regex.       $pid = '0';  # invalid PID while () {    if ((

RE: Problem with PING method

2001-11-30 Thread Gary MacDonald
The documentation for Net::Ping doesn't suggest that an IP address string (e.g., '192.168.1.1') has to be converted to a thirty-two bit integer.  Just use the IP address string (or a scalar containing the string):   print "Host is alive" if $p->ping('192.168.1.1');   Net::Ping d

RE: Win32::AdminMisc::GetEnvVar

2001-11-29 Thread Gary MacDonald
Title: RE: Win32::AdminMisc::GetEnvVar The hash containing the environmental variables is $List. Try something like this: Win32::AdminMisc::GetEnvVar(\%List, ENV_USER) || die "Cannot retrieve information.\n "; print "$key --> $List{$key}\n" foreach $key (sort keys %List); This function

RE: Need help with SplitMultis (REG_MULTI_SZ) using Win32::TieReg istry

2001-11-28 Thread Gary MacDonald
rse a REG_MULTI_SZ when you don't know how many component variables are stored within the value?   Thanks,   Jim       Jim>>> Gary MacDonald <[EMAIL PROTECTED]> 11/25/01 09:39PM >>> With SplitMultis set to 0, for a REG_MULTI_SZ value GetValue returns a st

RE: What is the name of a perl module to hide typed in text on th ecommand prompt

2001-11-28 Thread Gary MacDonald
use Term::ReadKey;##   Get password#print "\nPassword : ";ReadMode('noecho');my $password = ReadLine(0);print "\n\n";chomp $password;  "Monroe, John M" wrote: Hello all thanks for the help in advance. I am writing a perl script to reinstall sms for bunch of domain admins

RE: Need help with SplitMultis (REG_MULTI_SZ) using Win32::TieReg istry

2001-11-25 Thread Gary MacDonald
Title: RE: Need help with SplitMultis (REG_MULTI_SZ) using Win32::TieRegistry With SplitMultis set to 0, for a REG_MULTI_SZ value GetValue returns a string with the values separated by null, and ending with a double null:     Value1\x00Value2\x00\x00 which you could access by splitting

RE: selecting text from file

2001-11-25 Thread Gary MacDonald
Title: RE: selecting text from file Mea culpa ... the open and close functions in my examples should not, of course, be written in upper case. -Original Message-From: Gary MacDonald [mailto:[EMAIL PROTECTED]]Sent: Sunday, November 25, 2001 11:49 AMTo: [EMAIL PROTECTED

RE: selecting text from file

2001-11-25 Thread Gary MacDonald
Title: RE: selecting text from file Someone else has noted the problem of square brackets within your regular expressions. However, the basic algorithm is flawed as well.  Having identified the first token in the input stream, another record must be read before you check for the second token

RE: "The description for event ID..." messages when using Win32::EventLog messages

2001-11-22 Thread Gary MacDonald
ntended to be inserted into a predefined message resource that has been added to an .EXE or .DLL file.   Gary -Original Message-From: Gary MacDonald [mailto:[EMAIL PROTECTED]]Sent: Thursday, November 22, 2001 5:08 AMTo: [EMAIL PROTECTED]Subject: RE: "The descripti

RE: "The description for event ID..." messages when using Win32::EventLog messages

2001-11-22 Thread Gary MacDonald
Title: RE: "The description for event ID..." messages when using Win32::EventLog messages See Microsoft Knowledge Base article Q184719 for a description of the problem and a workaround. Gary -Original Message- From: Philip Morley [mailto:[EMAIL PROTECTED]] Sent: Thursday, November

RE: Modules for manipulating Exchange Mail box properties

2001-11-22 Thread Gary MacDonald
See the sample scripts in Thomas Eck's Windows NT/2000 ADSI Scripting for System Administration.  They're written in VB/VBScript, but can be converted to Perl using Win32::OLE.    -Original Message-From: Webb, Andy [mailto:[EMAIL PROTECTED]]Sent: Wednesday, November 21, 2001 3:23 PM

RE: Win32::OLE

2001-11-13 Thread Gary MacDonald
Title: RE: Win32::OLE There is a wealth of COM objects that are made accessible through the Win32::OLE module.   Included are ADSI, WMI, CDO, ADODB, to name a few. Click on the URL at the bottom of this message, and search the archives of this discussion group for the string "Win32::OLE". Yo

RE: WMI Help

2001-11-03 Thread Gary MacDonald
Title: RE: WMI Help According to the WMI SDK, the Status property of Win32_Process is a string.  The WMI Object Browser that comes with the SDK confirms that Status is a string, and also indicates that its value is for all instances of Win32_Process on my computer.  Win32::OLE returns undef f

RE: module or method for ARP (Address Resolution Protocol)

2001-11-02 Thread Gary MacDonald
Title: RE: module or method for ARP (Address Resolution Protocol) Actually, I wasn't happy with either of my earlier answers, since the original question really only requested a Perl-equivalent of the "arp -a" command.  And all that "arp -a" does is display the arp cache table.   So, attache

RE: module or method for ARP (Address Resolution Protocol)

2001-11-02 Thread Gary MacDonald
Title: RE: module or method for ARP (Address Resolution Protocol) For a generic solution, you can use NetPacket::ARP which is available on CPAN. For a Windows-specific solution you can use the sample script below which is provided as part of the WMI SDK. I've modified the script slightly by

RE: Process Help

2001-11-01 Thread Gary MacDonald
Title: RE: Process Help Assuming the machine is local, you could run tlist.exe within backticks, and then parse through the output.  For a remote machine, you could use the Resource Kit's 'rkill.exe /view' utility. Or you could use WMI.  Attached is a script written by Dave Roth which has a G

RE: Capture message to stderr in a Perl variable

2001-10-30 Thread Gary MacDonald
Title: Capture message to stderr in a Perl variable See       perldoc -q stderr   Gary -Original Message-From: Chavez Gutierrez, Freddy [mailto:[EMAIL PROTECTED]]Sent: Tuesday, October 30, 2001 10:49 AMTo: Perl (E-mail)Subject: Capture message to st

RE: Checking "closed" directories ?

2001-10-11 Thread Gary MacDonald
Title: RE: Checking "closed" directories ? Have a look at the NTSEC Security Tools (www.pedestalsoftware.com). I believe it will meet all your requirements. Gary -Original Message- From: Herold Heiko [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 11, 2001 2:28 AM To: List Per

RE: Subtracting two arrays

2001-10-01 Thread Gary MacDonald
Title: RE: Subtracting two arrays The expression @subset{@subset} is a hash slice. If @subset contained ('one', 'two') then    @subset{@subset} = (); is the equivalent of    @subset{'one', 'two'} = (undef, undef); or    $subset{'one'} = undef;    $subset{'two'} = undef; Another w

RE: Querying Service Pack

2001-09-28 Thread Gary MacDonald
Title: RE: Querying Service Pack Use Microsoft's HFNetChk utility.  http://www.microsoft.com/technet/treeview/default.asp?url=/technet/security/tools/hfnetchk.asp Gary -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, September 28, 2001 6:03 AM

RE: REGEX Premath $`

2001-09-20 Thread Gary MacDonald
Title: RE: REGEX Premath $` It's tough to figure out what you're trying to accomplish, since the "i" modifier on the regex doesn't make any sense, but if you want the "g" modifier to cause repeated passes on the string, then you need to place the regex in its own loop. Something like this:

WMI and Perl (WAS: Remote process)

2001-09-13 Thread Gary MacDonald
Title: WMI and Perl (WAS: Remote process) Go to msdn.microsoft.com and search for WMI.  You'll find the WMI SDK and the WMI Tutorial. Also see Marcin Policht's WMI Essentials for Automating Windows Management. Your second challenge will be how to convert the VBScript examples from the abov

RE: Accessing Exchange Hierarchy

2001-09-10 Thread Gary MacDonald
Title: RE: Accessing Exchange Hierarchy What version of Exchange?  Please elaborate on what you mean by Exchange Hierarchy. Gary -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, September 10, 2001 5:25 PM To: [EMAIL PROTECTED] Subject: Accessing E

RE: Redirecting Command Output to a file

2001-08-24 Thread Gary MacDonald
Title: RE: Redirecting Command Output to a file Search the archives of the Perl-Win32-Admin list for MAPI or SMTP. Gary -Original Message- From: Veeraraju_Mareddi [mailto:[EMAIL PROTECTED]] Sent: Friday, August 24, 2001 3:52 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Redi

RE: Help moving sub-directories in Perl...

2001-08-23 Thread Gary MacDonald
Title: RE: Help moving sub-directories in Perl... It is not clear from your code, but I'm assuming that 8am, 12pm, and 5pm are directories, which is what your subject line implies. You need to check the return value and print the $! variable if the call to the move function returns false. T

RE: disable user account

2001-08-13 Thread Gary MacDonald
You should check the return value from the UserSetMiscAttributes, and if false you should print the error message using:       print Win32::FormatMessage ( Win32::GetLastError() );   Gary -Original Message-From: Dan Navilliat [mailto:[EMAIL PROTECTED]]Sent: Friday, August 10, 20

RE: How can I get Perl to work like a bat file.

2001-07-29 Thread Gary MacDonald
Title: RE: How can I get Perl to work like a bat file. In addition to the replies you've already received ... you can use CMD's command separator '&&': $PgmReturn = system('cd /D C:\\install && setp.exe'); Using unquoted strings is a bad habit that will eventually cause you grief.  Backsla

RE: Setting columns per page

2001-06-08 Thread Gary MacDonald
Title: RE: Setting columns per page Simply insert four spaces at the left side of your format picture line.  For example, use strict; my $foo = 'Hello, World!'; write; # format STDOUT =     @<     $foo . Gary -Original Message- From: Kyle Payne [mailto:[EMAIL

RE: Missing FAQ link: How can I customize my installation of ActivePerl?

2001-06-05 Thread Gary MacDonald
If you have installed ActivePerl, then the missing section you cite below can be found in the Availability & Install subsection of the ActivePerl FAQ section of the HTML documentation installed on your local drive.   However, I don't think you'll find the answer to your question there.   The

RE: (no subject)

2001-05-30 Thread Gary MacDonald
Title: RE: (no subject) For NT 4.0 system administration using Perl, you should buy, borrow, or steal a copy of the following seminal texts:     Roth, Dave.  Win32 Perl Programming: The Standard Extensions.     Roth, Dave.  Win32 Perl Scripting: The Administrator's Handbook.

RE: Has anyone already invented the wheel....

2001-04-20 Thread Gary MacDonald
replace \x2F with /   Gary   -Original Message-From: Gary MacDonald [mailto:[EMAIL PROTECTED]]Sent: Friday, April 20, 2001 4:43 PMTo: 'Bateman, John [Austin-IS)'; Active State (E-mail)Subject: RE: Has anyone already invented the wheel This should get you started ...  

RE: Has anyone already invented the wheel....

2001-04-20 Thread Gary MacDonald
Title: 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:59my @servers = qw(server1 server2 server3);my @resources;#foreach my $server (@serv

RE: character/numeric in a string and bitwise operations.

2001-04-19 Thread Gary MacDonald
Title: character/numeric in a string and bitwise operations. From perlop:       If you are intending to manipulate bitstrings, you should be    certain that you're supplying bitstrings: If an operand is a    number, that will imply a numeric bitwise operation. You may    explicitly show whic

RE: Perl I/O redirection

2001-03-16 Thread Gary MacDonald
Title: From the Quirks section of the ActivePerl FAQ: STDIN and STDOUT, and Piping don't always work on NT. You may get unexpected results when you try to redirect the output of files that use Windows NT's file association feature. You can use pl2exe or pl2bat to convert a Perl script to a

RE: Automating unzipping of files

2001-03-15 Thread Gary MacDonald
Title: RE: Automating unzipping of files If you don't insist on a pure Perl solution, then a system call to pkunzip does just fine.  Here's a fragment of one of our scripts:     print "Beginning download ...\n";     $ftp->binary() or die "FTP binary failed\n";     $ftp->get($datfi

RE: Accessing a PST file

2001-03-09 Thread Gary MacDonald
Title: RE: Accessing a PST file How to determine if CDO is installed on a given machine?  Search the registry for the key "MAPI.Session", which indirectly links to the CDO.DLL library.   With Outlook 98, CDO is installed if you're running the Corporate or Workgroup version.   With Office 2

RE: Accessing a PST file

2001-03-09 Thread Gary MacDonald
es much of the Reference section in its appendices, but for all the gritty details you need to return to the Platform SDK.   Gary -Original Message-From: Thomas, Timothy B [mailto:[EMAIL PROTECTED]]Sent: Friday, March 09, 2001 1:52 PMTo: 'Gary MacDonald'; '[EMAIL

RE: Accessing a PST file

2001-03-09 Thread Gary MacDonald
Title: RE: Accessing a PST file Working with CDO in Perl is challenging because there's not much sample Perl code around to assist in porting the sample VB, VBA, and VBScript code that's available.   Below is a small working Perl script that purges the Deleted Items folder in a Personal Fold

RE: Accessing a PST file

2001-03-09 Thread Gary MacDonald
Title: RE: Accessing a PST file See the Microsoft Knowledgebase article Q171638.  The example is written in Visual Basic, but it can be ported to Perl using the Win32::OLE module. Professional CDO Programming, published by Wrox Press, is also an excellent resource.  Again, the examples

RE: e-mail attachments

2001-02-21 Thread Gary MacDonald
Title: RE: e-mail attachments Use MIME::Lite instead of Mail::Mailer. Here's some sample code: use strict; use MIME::Lite; # MIME::Lite->send('smtp', 'mail.peanutgallery.net'); # # send a text attachment with no message # my $msg = MIME::Lite->new(     From =>'[EMAIL PROTECTED]',     T

RE: convert comp3 data question

2001-01-23 Thread Gary MacDonald
Title: RE: convert comp3 data question Have a look at Convert::IBM390.  See http://search.cpan.org/doc/GROMMEL/Convert-IBM390-0.12/IBM390.pm Gary W. MacDonald -Original Message- From: John.F.Kennedy [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 23, 2001 8:58 AM To: [EMAIL P

RE: Mailbox adsi and otherMailbox

2001-01-09 Thread Gary MacDonald
Title: RE: Mailbox adsi and otherMailbox The Perl examples I've seen all used a reference to an anonymous array, so I'd try passing an array reference in the call.     $mailBox->PutEx(2,'otherMailbox',\@Others) Gary W. MacDonald -Original Message- From: Durant, Ryan A [mailto:

RE: An unidentified error message!

2001-01-02 Thread Gary MacDonald
Title: RE: An unidentified error message! OK ... so under Win32, $^E and Win32::GetLastError() often report the same information. Under what operating system are you running this code?  What version of Perl? Please run this small script (after making appropriate substitutions for DOMAIN, f

RE: An unidentified error message!

2001-01-02 Thread Gary MacDonald
Title: RE: An unidentified error message! Use     print Win32::FormatMessage(Win32::GetLastError()); instead of     print "$^E"; Gary W. MacDonald -Original Message- From: Gupta, Priyanka [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 02, 2001 1:00 PM To: '[EMAIL

RE: NT & Exchange

2000-12-24 Thread Gary MacDonald
Title: RE: NT & Exchange Try using "PESSIMISM" as the string for your server. Assuming the server is a PDC or a BDC, the fact that Exchange is also installed on the machine won't interfere with your ability to add or remove users from the SAM database. Gary W. MacDonald -Original

RE: Run in background

2000-12-02 Thread Gary MacDonald
Title: RE: Run in background You could try either of these commands:     nohup perl-script & or     at now + 1 minute     perl-script     ^D (Apparently "at teatime" is legal too, but not useful in this instance :-) Gary W. MacDonald -Original Message- From: PerlWin32 [mailto:[

RE: Remote admin with multiple passwords?

2000-12-01 Thread Gary MacDonald
Title: RE: Remote admin with multiple passwords? You should be able to administer remotely by connecting to the IPC$ share on each workstation. use strict; use Win32::NetResource; my %hash = (RemoteName => 'workstation\\IPC$'); my $password = 'x'; my $username = 'x'; Win32::NetRe

RE: :Ping ko

2000-12-01 Thread Gary MacDonald
Title: RE: :Ping ko The documentation for Net::Ping says: pingecho() or a ping object with the tcp protocol use alarm() to implement the timeout. So, don't use alarm() in your program while you are using pingecho() or a ping object with the tcp protocol. The udp and icmp protocols do not use

RE: AdminMisc::LogonAsUser

2000-11-28 Thread Gary MacDonald
Title: RE: AdminMisc::LogonAsUser Use this to view the error from Win32::AdminMisc ...     use Win32;     print Win32::FormatMessage(Win32::GetLastError()); Gary W. MacDonald -Original Message- From: Sheldon Fuchs [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 28, 2000 9:11 A

RE: Benchmarking or timing Perl scripts?

2000-11-26 Thread Gary MacDonald
Title: RE: Benchmarking or timing Perl scripts? See the Devel::DProf module.  There's a helpful discussion of the module in the 3rd edition of Programming Perl. Gary W. MacDonald -Original Message- From: P J [mailto:[EMAIL PROTECTED]] Sent: Saturday, November 25, 2000 1:21 PM To: [