Home Dashboard Directory Help
Search

Powershell 4: in cmdlet "Get-AdUser" -Properies parameter doesn't accept wildcard * by MariaAmparo


Status: 

Active


13
0
Sign in
to vote
Type: Bug
ID: 792665
Opened: 7/5/2013 6:29:24 AM
Access Restriction: Public
1
Workaround(s)
view
9
User(s) can reproduce this bug

Description

In Powershell v3 this works fine:

get-AdUser -Identity user1 -Properties * | Select "*phone*"

but in Powershell v4 it returns an error "Invalid property"

Thanks.
Details
Sign in to post a comment.
Posted by Regnor on 10/17/2013 at 10:46 PM
This bug is still present in the current RTM version of Windows 8.1 and propably also in 2012R2.
Sign in to post a workaround.
Posted by Matthew McDonald at ION on 1/15/2014 at 9:28 AM
In some cases you can use a workaround by piping Get-ADUser to Get-ADObject. For example: get-AdUser -Identity user1 | Get-ADObject -Properties * | Select "*phone*"

Unfortunately this does not work for all properties of an AD user account as they seem to be only available with get-ADUser, e.g. PasswordExpired, PasswordLastSet, PasswordNeverExpires, and PasswordNotRequired. Those are just some I've noticed personally.