Please feel free to provide feedback or file bugs here.

PowerShell 5 - bug in GetType() for COM objects IADSUser

Votes from Connect: 9

Original Date Submitted: 6/16/2015 3:12:31 AM

Description:
********Contact Information********
Handle: Ondrej Sevecek
Site Name: PowerShell
Feedback ID: 1437366
***************************************

Frequency: PowerShell
Regression: run the mentioned script on Windows 10.0.10074 in its built-in PowerShell 5.

Problem Description:
When I run the following on Windows 10.0.10074 in PowerShell 5, it does not work for user members of the local group:

$admins = [ADSI] 'WinNT://./Administrators,group'

foreach ($oneMember in $admins.Members()) {

$oneMemberName = $oneMember.GetType().InvokeMember('Name', 'GetProperty', $null, $oneMember, $null)
Write-Host $oneMemberName

}

The error is: Error while invoking GetType. Could not find member.

While the code works fine on any other OS (tested on Windows XP, Vista, 7, 8, 8.1) within PowerShell 2,3,4. It also works fine within PowerShell 2 on Windows 10.0.10074.

Product Studio item created by Connect Synchronizer due to creation of feedback ID 1437366 (http://connect.microsoft.com/PowerShell/feedback/ViewFeedback.aspx?FeedbackID=1437366).

Repro Steps:
run the mentioned script on Windows 10.0.10074 in its built-in PowerShell 5.

Expected Results:
it should run well :-)

Internal BugId: 15570

15 votes
Sign in
(thinking…)
Password icon
Signed in as (Sign out)

We’ll send you updates on this idea

AdminJoey Aiello [MSFT] (Program Manager, Windows Server) shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

0 comments

Sign in
(thinking…)
Password icon
Signed in as (Sign out)
Submitting...

Feedback and Knowledge Base