-resent as I was unaware I was sending to an incorrect list previously-
 
Good Day All,
 
I've been searching around for the proper syntax to remove a machine account from a Windows Domain.  Here is the code I believe should accomplish that task: (I've also tried the domain controller name in lieu of DOMAINNAME)
---------
use strict;
use Win32::NetAdmin;
 
my $PC_name = shift;
 
if (Win32::NetAdmin::UserDelete("\\\\DOMAINNAME", "\\\\$PC_name")) {
    print "$PC_name has been removed.";
} else {
    print "No such account $PC_name.";
}
--------
 
Am I using the correct module and function?  I see no MachineDelete function in NetAdmin.  Is this even the appropriate module?  Thanks in advance for any direction provided.  As one may have guessed, I am rather new to perl.
 
Regards,
c.barbet
 

Reply via email to