Software Squirrel
asked on
PowerShell not showing info
I ran this script. It contacts AD but does not respond with results. It just waits for another entry.
C:\Save> Get-ADUser -Filter {mail -like 'emailaddress'} -Properties * | fl workid
C:\Save> _
It looks like above
C:\Save> Get-ADUser -Filter {mail -like 'emailaddress'} -Properties * | fl workid
C:\Save> _
It looks like above
ASKER
Yes, it is another property, but anyway, I don't even get that. I just get nothing.
It acts like I just inserted:
C:\Save> Get-ADUser
C:\Save>_
It acts like I just inserted:
C:\Save> Get-ADUser
C:\Save>_
Get-ADUser -Filter {mail -like '<email address>'} -Properties * | fl
still indicates that the AD powershell module either inst installed or isnt loaded.
import-module activeDirectory
ASKER
@Hayes Jupe
C:\Save>import-module activeDirectory
C:\Save>PS C:\Windows\system32> Get-ADUser -Filter {mail -like '<email address>'} -Properties * | fl workid
C:\Save>_
Also, @David Johnson, Same result after adding <...>
C:\Save>import-module activeDirectory
C:\Save>PS C:\Windows\system32> Get-ADUser -Filter {mail -like '<email address>'} -Properties * | fl workid
C:\Save>_
Also, @David Johnson, Same result after adding <...>
import-module activeDirectory -erroraction stop
my comment was to remove workid from 'fl workid'
ASKER
David Johnson, CD
Same after -erroraction stop
Same after -erroraction stop
ASKER
then it means no objects were returned from your code.
Get-ADUser -Filter {EmailAddress -like "abc@def.com"} -Properties * | Select Name, SamAccountName, EmailAddress
|
ASKER
The first time I run in PS, it pops up the window like its processing something and then goes away quickly (so, I cannot see what it is saying). Then back to the prompt
ASKER
I am not getting errors, so maybe it's just a user issue not having access to AD. I will try another user account.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
That worked
so then the filter {mail -like 'emailaddress'} is not matching try -eq instead
ASKER
Get-ADUser -Filter {mail -eq 'abc@email.com'} -Properties * | fl workid
same result , nothing
Removed | fl workid
same result, nothing
same result , nothing
Removed | fl workid
same result, nothing
it is not 'mail' but 'EmailAddress'
ASKER
I tried EmailAddress with both -like and -eq
I also removed | fl workid and just ended with -Properties *
Same result
I also removed | fl workid and just ended with -Properties *
Same result
ASKER
Only one with results was
Get-ADUser -Filter * -Properties * | Select Name, SamAccountName, EmailAddress
Get-ADUser -Filter * -Properties * | Select Name, SamAccountName, EmailAddress
ASKER
I was able to get it with Get-ADUser -Filter {EmailAddress -eq "abc@email.com"} -Properties *
ASKER
David Johnson, CD 's solution helped me identify that the values I was searching are empty. The query I originally had was right, but I did not get feedback from my query.
i run the same and get (keep in mind that "workID" doesnt exist in my AD - i assume thats a custom property in yours.)