I have used the following query to list the users in a windows 2008 server, but failed and got the below error.
$server=\'client-pc-1\';$pwd= convertto-secur
For the particular case of Windows 10 October 2018 Update or later activedirectory module is not available unless the optional feature RSAT: Active Directory Domain Services and Lightweight Directory Services Tools is installed (instructions here + uncollapse install instructions).
Reopen Windows Powershell and import-module activedirectory will work as expected.