{"id":545,"date":"2013-02-18T22:06:44","date_gmt":"2013-02-18T21:06:44","guid":{"rendered":"http:\/\/www.jbahillo.com\/?page_id=545"},"modified":"2013-02-21T18:22:46","modified_gmt":"2013-02-21T17:22:46","slug":"perl-zentyal-ldap-passwords-change","status":"publish","type":"page","link":"https:\/\/www.jbahillo.com\/?page_id=545","title":{"rendered":"[Perl] Zentyal LDAP Passwords change"},"content":{"rendered":"<p>This is a small script I have done today in Zentyal that allows you to change the passwords of all users in LDAP. It creates a file \/tmp\/usuarios.csv with the users and their new passwords<\/p>\n<pre class=\"brush: perl; auto-links: true; collapse: false; gutter: true; first-line: 1; highlight: []; html-script: false; light: false; pad-line-numbers: true; toolbar: true; wrap-lines: true\">\n#!\/usr\/bin\/perl\nuse strict;\nuse warnings;\nuse EBox;\nuse EBox::UsersAndGroups;\nuse EBox::Global;\nuse EBox::Util::Random;\nEBox::init();\n\nmy $salida =&quot;\/tmp\/users.csv&quot;;\nopen (OUT,&quot;&gt;$out&quot;) || die &quot;ERROR: Can&#039;t create or write to file $out\\n&quot;;\nmy $users = EBox::Global-&gt;modInstance(&#039;users&#039;);\nmy @userlist = @{$users-&gt;users()   }  ;\nforeach my $user (@userlist) {\n        my $password;\n        $password =  EBox::Util::Random::generate(8);\n        print OUT $user-&gt;name().&quot; &quot;. $password.&quot;\\n&quot;;\n        $user-&gt;changePassword($password,0)\n}\n  close (OUT); \n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This is a small script I have done today in Zentyal that allows you to change the passwords of all users in LDAP. It creates a file \/tmp\/usuarios.csv with the users and their new passwords #!\/usr\/bin\/perl use strict; use warnings;&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"https:\/\/www.jbahillo.com\/?page_id=545\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":21,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"ep_exclude_from_search":false,"footnotes":""},"class_list":["post-545","page","type-page","status-publish","hentry"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"A small script that allows you to change all Zentyal LDAP passwords in a go\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"keywords\" content=\"zentyal,passwords,ldap\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.jbahillo.com\/?page_id=545\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"es_ES\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Javier Bahillo | Blog de un Administrador de Sistemas\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Zentyal Bulk LDAP passwords change | Javier Bahillo\" \/>\n\t\t<meta property=\"og:description\" content=\"A small script that allows you to change all Zentyal LDAP passwords in a go\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.jbahillo.com\/?page_id=545\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2013-02-18T21:06:44+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2013-02-21T17:22:46+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Zentyal Bulk LDAP passwords change | Javier Bahillo\" \/>\n\t\t<meta name=\"twitter:description\" content=\"A small script that allows you to change all Zentyal LDAP passwords in a go\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.jbahillo.com\\\/?page_id=545#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.jbahillo.com#listItem\",\"position\":1,\"name\":\"Inicio\",\"item\":\"https:\\\/\\\/www.jbahillo.com\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.jbahillo.com\\\/?page_id=545#listItem\",\"name\":\"[Perl] Zentyal LDAP Passwords change\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.jbahillo.com\\\/?page_id=545#listItem\",\"position\":2,\"name\":\"[Perl] Zentyal LDAP Passwords change\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.jbahillo.com#listItem\",\"name\":\"Inicio\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.jbahillo.com\\\/#organization\",\"name\":\"Javier Bahillo\",\"description\":\"Blog de un Administrador de Sistemas\",\"url\":\"https:\\\/\\\/www.jbahillo.com\\\/\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.jbahillo.com\\\/?page_id=545#webpage\",\"url\":\"https:\\\/\\\/www.jbahillo.com\\\/?page_id=545\",\"name\":\"Zentyal Bulk LDAP passwords change | Javier Bahillo\",\"description\":\"A small script that allows you to change all Zentyal LDAP passwords in a go\",\"inLanguage\":\"es-ES\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.jbahillo.com\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.jbahillo.com\\\/?page_id=545#breadcrumblist\"},\"datePublished\":\"2013-02-18T22:06:44+01:00\",\"dateModified\":\"2013-02-21T18:22:46+01:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.jbahillo.com\\\/#website\",\"url\":\"https:\\\/\\\/www.jbahillo.com\\\/\",\"name\":\"Javier Bahillo\",\"description\":\"Blog de un Administrador de Sistemas\",\"inLanguage\":\"es-ES\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.jbahillo.com\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Zentyal Bulk LDAP passwords change | Javier Bahillo","description":"A small script that allows you to change all Zentyal LDAP passwords in a go","canonical_url":"https:\/\/www.jbahillo.com\/?page_id=545","robots":"max-image-preview:large","keywords":"zentyal,passwords,ldap","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BreadcrumbList","@id":"https:\/\/www.jbahillo.com\/?page_id=545#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.jbahillo.com#listItem","position":1,"name":"Inicio","item":"https:\/\/www.jbahillo.com","nextItem":{"@type":"ListItem","@id":"https:\/\/www.jbahillo.com\/?page_id=545#listItem","name":"[Perl] Zentyal LDAP Passwords change"}},{"@type":"ListItem","@id":"https:\/\/www.jbahillo.com\/?page_id=545#listItem","position":2,"name":"[Perl] Zentyal LDAP Passwords change","previousItem":{"@type":"ListItem","@id":"https:\/\/www.jbahillo.com#listItem","name":"Inicio"}}]},{"@type":"Organization","@id":"https:\/\/www.jbahillo.com\/#organization","name":"Javier Bahillo","description":"Blog de un Administrador de Sistemas","url":"https:\/\/www.jbahillo.com\/"},{"@type":"WebPage","@id":"https:\/\/www.jbahillo.com\/?page_id=545#webpage","url":"https:\/\/www.jbahillo.com\/?page_id=545","name":"Zentyal Bulk LDAP passwords change | Javier Bahillo","description":"A small script that allows you to change all Zentyal LDAP passwords in a go","inLanguage":"es-ES","isPartOf":{"@id":"https:\/\/www.jbahillo.com\/#website"},"breadcrumb":{"@id":"https:\/\/www.jbahillo.com\/?page_id=545#breadcrumblist"},"datePublished":"2013-02-18T22:06:44+01:00","dateModified":"2013-02-21T18:22:46+01:00"},{"@type":"WebSite","@id":"https:\/\/www.jbahillo.com\/#website","url":"https:\/\/www.jbahillo.com\/","name":"Javier Bahillo","description":"Blog de un Administrador de Sistemas","inLanguage":"es-ES","publisher":{"@id":"https:\/\/www.jbahillo.com\/#organization"}}]},"og:locale":"es_ES","og:site_name":"Javier Bahillo | Blog de un Administrador de Sistemas","og:type":"article","og:title":"Zentyal Bulk LDAP passwords change | Javier Bahillo","og:description":"A small script that allows you to change all Zentyal LDAP passwords in a go","og:url":"https:\/\/www.jbahillo.com\/?page_id=545","article:published_time":"2013-02-18T21:06:44+00:00","article:modified_time":"2013-02-21T17:22:46+00:00","twitter:card":"summary","twitter:title":"Zentyal Bulk LDAP passwords change | Javier Bahillo","twitter:description":"A small script that allows you to change all Zentyal LDAP passwords in a go"},"aioseo_meta_data":{"post_id":"545","title":"Zentyal Bulk LDAP passwords change | #site_title","description":"A small script that allows you to change all Zentyal LDAP passwords in a go","keywords":[{"label":"Zentyal","value":"Zentyal"},{"label":"passwords","value":"passwords"},{"label":"LDAP","value":"LDAP"}],"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[],"defaultGraph":"","defaultPostTypeGraph":""},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2021-04-23 00:43:21","updated":"2025-06-03 23:08:31","seo_analyzer_scan_date":null},"jetpack_shortlink":"https:\/\/wp.me\/P74T96-8N","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.jbahillo.com\/index.php?rest_route=\/wp\/v2\/pages\/545","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jbahillo.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.jbahillo.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.jbahillo.com\/index.php?rest_route=\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jbahillo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=545"}],"version-history":[{"count":4,"href":"https:\/\/www.jbahillo.com\/index.php?rest_route=\/wp\/v2\/pages\/545\/revisions"}],"predecessor-version":[{"id":551,"href":"https:\/\/www.jbahillo.com\/index.php?rest_route=\/wp\/v2\/pages\/545\/revisions\/551"}],"wp:attachment":[{"href":"https:\/\/www.jbahillo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=545"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}