Question

I'm using cmdlet Get-QADUser (by Quest software) to list domain users from Active Directory. The output is several hundreds of rows with domain names and email addresses. I need to select only those rows, where is email address and assign them to a separate variable.

This is part of $domain_names variable:

turbekova                                                   turbek@dock.com                                                       
senajova                                                    senaj@dock.com                                                       
mackova                                                                                                            
pukansky                                                    pukansky@dock.com                                                       
tiko                                                        tiko@dock.com                                                       
dvorska                                                                                                            
trescanska                                                  tresc@dock.com          

Thank you

Était-ce utile?

La solution

This show users with email using parameter of property you choose and wildcard:

 Get-QADUser -Email * | select samaccountname, email

Autres conseils

You can filter with Where-Object:

$hasEmail = Get-QADUser | Where-Object { $_.Email }

Or whatever the column is named. You chose to not include the property names in your copied output.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top