Forum Discussion
Steve_Brown_882
Mar 10, 2011Historic F5 Account
create_user_3 in a perl script
Hey Guys,
I don't do a lot of perl scripting so I am hoping for a little help getting a script to work. Basically I have pieced som code together from the forums but it doesn't quite work. ...
Steve_Brown_882
Mar 11, 2011Historic F5 Account
Thanks for the input Joe. I made a few changes, but still not working. It actually runs without error but doesn't create the user so I am guessing I still have something wrong with $UserInfo
!/usr/bin/perl
use SOAP::Lite;
sub SOAP::Transport::HTTP::Client::get_basic_credentials
{
return "admin" => "admin";
}
$UserManagement = SOAP::Lite
-> uri('urn:iControl:Management/UserManagement')
-> readable(1)
-> proxy("https://192.168.10.100/iControl/iControlPortal.cgi");
&handle_create();
sub handle_create()
{
my ($UserName, $FullName, $Role, $Partition ) = @_;
if ( $UserName eq "" ) { $UserName = "testuser1"; }
if ( $FullName eq "" ) { $FullName = "New User"; }
if ( $Role eq "" ) { $Role = USER_ROLE_GUEST ; }
if ( $Partition eq "" ) { $Partition = "Common" ; }
$Password = {
is_encrypted => "false",
password => ""
};
$UserID = {
name => $UserName,
full_name => $FullName
};
$UserPermissions = {
role => $Role,
partition => $Partition
};
$UserInfo = {
user => [$UserID],
password => [$Password],
permisisions => [$UserPermissions],
login_shell => "/bin/bash",
};
$soapResponse = $UserManagement->create_user_3(
SOAP::Data->name(users => [$UserInfo])
);
};
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects