Hello,
use the Java API to do this.
1.) AuthorityService.getAllAuthoritiesInZone(String zoneName, AuthorityType type) to get all the users - use zoneName = Your LDAP zone name (lookup via NodeBrowser in /sys:system/cm:zones) and type = AuthorityType.USER to restrict to only users
2.) for each user, do AuthorityService.removeAuthorityFromZone(String userName, Set<String> zones) to remove it from the old zone - use zones = Collections.singleton(zoneName) to wrap the single zone into a set
3.) for each user, do AuthorityService.addAuthorityToZones(String userName, Set<String> zones) to add it to the new zone - use zones = Collections.singleton(AuthorityService.ZONE_AUTH_ALFRESCO) to wrap the single zone into a set
4.) for each user, do MutableAuthenticationService.createAuthentication(String userName, char[] password) to create the Alfresco user account
Afterwards, you can disable/enable the account as required.
Regards
Axel