Use the blue Nav bar above to access the main index pages!

Find an SPN in Active Directory using Perl

How to find a servicePrincipleName (SPN) in Active Directory using Perl. Click here to find an SPN using VBScript.

This script searches Active Directory for user accounts that have the specified SPN associated with them. This is handy if you have duplicate SPN's you want to get rid of. This is just another variation on my ADO search script in a previous post Search Active Directory from Perl Using ADO.

use Win32::OLE;
$c = Win32::OLE->new("ADODB.Connection");
$c->{Provider} = "ADsDSOObject";
$c->Open("ADSI Provider");
$comm->{Properties}->{'Page Size'}=1000;
$rs = Win32::OLE->new("ADODB.RecordSet");
until ($rs->EOF){
 print "$spn is registered to $sam\n";


Post a Comment

Related Posts Plugin for WordPress, Blogger...