protected function execute($arguments = array(), $options = array())
 {
     // initialize the database connection
     $databaseManager = new sfDatabaseManager($this->configuration);
     $connection = $databaseManager->getDatabase($options['connection'] ? $options['connection'] : null)->getConnection();
     $hostname = $arguments['hostname'];
     $path = $arguments['path'] ? $arguments['path'] : '/tmp';
     if ($hostname == 'all') {
         $hostnames = SambaAccountPeer::getHostnames();
     } else {
         $hostnames[] = $hostname;
     }
     foreach ($hostnames as $hostname) {
         $fh = fopen($path . '/' . $hostname . '.smbpasswd', 'w');
         foreach (SambaAccountPeer::getActiveAccounts($hostname) as $samba_account) {
             fwrite($fh, $samba_account->getSmbpasswdLine() . "\n");
         }
         fclose($fh);
     }
 }