简体   繁体   中英

How can I check if a groupname exists in Active Directory using CMD or Perl

I'm trying to write a Perl script which checks if a user group name exists in the Active Directoy. Important for me is, that I don't have to load an additional library, that's why i want to use the System command and call CMD.

I also thought about calling a Power Shell command, but this is rather problematic, because we have a lot of older servers without PS.

This might be a late answer; however the module Net::LDAP probably could be something for you. As described on their homepage; it is "a collection of modules that implements a LDAP services API for Perl programs. The module may be used to search directories or perform maintenance functions such as adding, deleting or modifying entries."

An object could be searched by this example also provided by their homepage :

use Net::LDAP;
$mesg = $ldap->search(@search_args);
@entries = $mesg->entries;  

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM