Mangling Exchange GUIDs

I spent a good few hours today attempting to use the MailboxGUID returned from the WMI Exchange provider to search for the associated Active Directory account, using the msExchMailboxGuid attribute.

Here's two functions I came up with in the end. One to convert MailboxGUID to something that a search on msExchMailboxGuid will like:

sub exch_to_ad {
  my $guid = shift;
  $guid =~ s/[\{\}]+//g;
  my $string = '';
  my $count = 0;
  foreach my $part ( split /\-/, $guid ) {
    if ( $count >= 4 ) {
      $string .= "\\$_" for unpack "(A2)*", $part;
    else {
      $string .= "\\$_" for reverse unpack "(A2)*", $part;
  return $string;

And another to take a msExchMailboxGuid field, which is a byte array, and convert it to a MailboxGUID.

sub ad_to_exch {
  my $guid = shift;
  my @vals = map { sprintf("%.2X", ord $_) } unpack "(a1)*", $guid;
  my $string = '{';
  $string .= join '', @vals[3,2,1,0], '-', @vals[5,4], '-', 
     @vals[7,6], '-', @vals[8,9], '-', @vals[10..$#vals], '}';
  return $string;

Hopefully this should save other people some time.

Perl v5.13.7 released

  {Neo sees a black cat walk by them, and then a similar black
      cat walk by them just like the first one}
  Neo:      Whoa. Deja vu.
  {Everyone freezes right in their tracks}
  Trinity:  What did you just say?
  Neo:      Nothing. Just had a little deja vu.
  Trinity:  What did you see?
  Cypher:   What happened?
  Neo:      A black cat went past us, and then another that
               looked just like it.
  Trinity:  How much like it? Was it the same cat?
  Neo:      It might have been. I'm not sure.
  Morpheus: Switch! Apoc!
  Neo:      What is it?
  Trinity:  A deja v…

Switching CPANPLUS test reports to Metabase

With the switching off the CT1.0/SMTP mechanism on September 1st casual CPAN testers, those users who submit test reports when they install or update their modules, will need to switch to the new Metabase system.

For CPANPLUS users this just got a little bit easier.

Task::CPANPLUS::Metabase should make configuring CPANPLUS a lot easier. Simply install T…

CPAN Testers 2.0 and the metabase-relayd

So CPAN Testers 2.0 was announced and further here.

Big kudos to all concerned

When I met David Golden and Ricardo Signes at the Birmingham QA Hackathon in 2009 and discussions were happening about Metabase and how submissions would be made to it, I'd expressed concern about the weight of the dependencies that would be required to make Metabase submissions.

I came up with the idea of a Metabase relay server, something that would act as an intermediate between …

And Dist::Zooky too!

Dist::Zilla is fantastic, but I seem to have quite a few distributions I wanted to convert and doing the boilerplate for dist.ini from an existing distribution can be a little tedious.

Wouldn't it be great if there was a tool to do this for me?

And so Dist::Zooky was born.

( Embarressingly I had to explain the reference to RJBS, who found ="http://w…

About bingos

user-pic System administrator, part-time Perl hacker, full-time POE [] evangelist. One day he will be made to pay for his crimes. He has some modules on CPAN []. They may or may not be useful