简体   繁体   中英

Active Directory commands work under PowerShell but not with command prompt

Active Directory commands issued by my Perl script are working from PowerShell but not when I run it from the command prompt.

Is there any way to run these commands from the command prompt?

The commands that I am using are dsadd , dsrm , dsmod etc.

The problem is almost certainly that the PATH environment variable doesn't include the directory where the Active Directory tools are stored

To find where they are on your system, under PowerShell enter

where.exe dsadd

This will show the full path to sdadd

(If you use just where as normal then PowerShell will use the where cmdlet which is an entirely different thing)

If you then modify the PATH variable on the command prompt to include the path revealed above then Active Directory commands will work just as they do on PowerShell

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