Skip to content

Instantly share code, notes, and snippets.

@nfabre
Created November 30, 2010 09:07
Show Gist options
  • Save nfabre/721391 to your computer and use it in GitHub Desktop.
Save nfabre/721391 to your computer and use it in GitHub Desktop.
create-user.php
<?php
// Recuperation du "HostLocalAccountManager " pour pouvoir creer l'utilisateur
$accountManager = $serviceContent->returnval->accountManager;
// Instanciation
$hostAccountSpec = new Vmware\DataObject\Host\AccountSpec();
// Configuration de l'utilisateur
$hostAccountSpec->setId('userName');
$hostAccountSpec->setPassword('password');
$hostAccountSpec->setDescription("my delegated admin auto-agent software");
// Creation de la requete SOAP
$soapMessage = array(
'_this' => new SoapVar($accountManager->{'_'}, XSD_STRING, $accountManager->type),
'user' => new SoapVar($hostAccountSpec,SOAP_ENC_OBJECT,'HostAccountSpec')
);
// Creation de l'utilisateur
$connection->createUser($soapMessage);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment