Hi Dwayne,
Here is the code:
sub add_domain_user($$$) {
my $z_obj = shift;
my $domain_user = shift;
my $ontap_group = shift;
# Build the useradmin-domainuser-add request, adding
# the domain user to the Administrators group.
my $in = NaElement->new("useradmin-domainuser-add");
$in->child_add_string("user-identifier", $domain_user);
my $group = NaElement->new("useradmin-groups");
$in->child_add($group);
my $group_info = NaElement->new("useradmin-group-info");
$group->child_add($group_info);
$group_info->child_add_string("name", $ontap_group);
if ($debug > 0) {
print "Sending:\n" . $in->sprintf() . "\n";
}
# Invoke useradmin-domainuser-add
my $out = $z_obj->invoke_elem($in);
if ($out->results_status() eq "failed") {
my $error = $out->results_reason();
print "useradmin-domainuser-add failed with $error.\n";
exit 5;
}
And it worked just fine. Here is the code I called it with:
add_domain_user($s, $domain_user, "Administrators");
You might consider adding an sprintf() on the input variable before the elem_invoke() call.
I also see that you are using "Administrator", and I'm using "Administrators". Make sure that you are seeing "Administrator" in useradmin group list command or useradmin-group-list API output.
As you stated above, the domain user is "<domain>\<user>", for example, "EIM\rick".
As for HOST.EQUIV style, I don't see any problem. I assume that you have other APIs working using this style. If not, then add to the code a system-get-version invoke. I do this a lot to verify the connection.
Regards,
- Rick -