Link to home
Start Free TrialLog in
Avatar of 25112
25112

asked on

equivalent of dsquery in POWERSHELL (WIN7)

not able to run below due to no admin permission to install pack..

DSQUERY USER -samid rty| DSGET USER -memberof -expand
can it be run in powershell?
Avatar of Arana (G.P.)
Arana (G.P.)

you can use Get-ADUser –Filter * -Searchbase “OU=IT,DC=xxxxxxxx,DC=xxx“
in powershell
Avatar of 25112

ASKER

Can you guide this error: (this is in powershell in win7)

The term 'Get-ADUser' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:11
+ Get-ADUser <<<<  -Filter  "CN=rty"
    + CategoryInfo          : ObjectNotFound: (Get-ADUser:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
SOLUTION
Avatar of Arana (G.P.)
Arana (G.P.)

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of 25112

ASKER

I tried:
import-module activedirectory

results:
Import-Module : The specified module 'activedirectory' was not loaded because no valid module file was found in any mod
ule directory.
At line:1 char:14
+ import-module <<<<  activedirectory
    + CategoryInfo          : ResourceUnavailable: (activedirectory:String) [Import-Module], FileNotFoundException
    + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial