July 2017
Intermediate to advanced
648 pages
31h 9m
English
Alternatively, we could check Active Directory instead of using the Exchange cmdlet, which is typically faster. To achieve the same result as the previous example, we would run the following command:
Get-ADUser -Filter {mail -like "*"} `-Properties mail, SamAccountName, DisplayName | `? {$_.mail -match "d"} | `FT DisplayName, SamAccountName, mail -Auto
In this example, instead of using Get-Mailbox , we use the Get-ADUser cmdlet to retrieve any Active Directory account that has something on its mail attribute. Then, we check whether the content of this property has a digit in it and, if yes, we print the same user details as before. The reason why we check mail twice is because -Filter does not support the -match operator. ...
Read now
Unlock full access