Get-ADUser all properties issue - LockedOut property is missing

Welcome Forums General PowerShell Q&A Get-ADUser all properties issue - LockedOut property is missing

This topic contains 5 replies, has 4 voices, and was last updated by

 
Participant
1 month, 2 weeks ago.

  • Author
    Posts
  • #118794

    Participant
    Points: 35
    Rank: Member

    Hi,

    I have a strange issue , as the title says , when i issue a command on a powershell console in Windows 2016 DC like

    Get-ADUser myuser -Properties *

    The LockedOut property (and possible others) is not displayed , but on another windows server 2016 powershell console is displayed.

    PS Z:\> Compare-Object -ReferenceObject $(get-aduser myuser -Properties *) -DifferenceObject $(Import-Clixml .\myuser.xml) -Property lockedout
    
    lockedout SideIndicator
    --------- -------------
              =>
    False     < =

    Difference Server

    Name                           Value
    ----                           -----
    PSVersion                      5.1.14393.2515
    PSEdition                      Desktop
    PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
    BuildVersion                   10.0.14393.2515
    CLRVersion                     4.0.30319.42000
    WSManStackVersion              3.0
    PSRemotingProtocolVersion      2.3
    SerializationVersion           1.1.0.1

    Reference Server

    PS Z:\> $PSVersionTable
    
    Name                           Value
    ----                           -----
    PSVersion                      5.1.14393.2580
    PSEdition                      Desktop
    PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
    BuildVersion                   10.0.14393.2580
    CLRVersion                     4.0.30319.42000
    WSManStackVersion              3.0
    PSRemotingProtocolVersion      2.3
    SerializationVersion           1.1.0.1

    Any ideas ?

  • #118795

    Participant
    Points: 814
    Helping Hand
    Rank: Major Contributor

    What is in the object that you used to create myuser.xml. If you didn't use -Properties * for that execution, then these properties will not show.

  • #118890
    js

    Participant
    Points: 315
    Helping Hand
    Rank: Contributor

    It works for me. Is it possible that before you exported to xml, you didn't specify the "-properties *" option to get-aduser?

  • #118896

    Participant
    Points: 190
    Helping Hand
    Rank: Participant

    Where the lockout is not visible, are you running the powershell session as administrator?
    Meaning selecting "Run As Administrator" when you launch powershell.

    Some fields are not visible without it.

  • #119037

    Participant
    Points: 35
    Rank: Member

    Hi , thanks for the the replies.
    Its strange , i haven't run as administrator in either of the cases but one of the servers is actually a Win 2016 Core , and i noticed that even though i login with my Active Directory account , which is an Enterprise Admin , when it opens the cmd prompt it is opened as administrator , and consequently when i run 'start powershell', the powershell console is also opened as administrator. (i'm talking about RDP login/connection here)

    On the server where i exported the myuser.xml , i did run the Get-ADUser with -Properties * and not opened the console as administrator.
    However , as i was reading the replies , i deleted the shortcut on the taskbar , pined it again and now it does display the LockedOut property 🙂
    I really have no idea what was the issue or if there were other properties also that were not displayed , maybe i should have run a measure-object on the properties to see a count.

    Now i guess it's to late , but are the same on both servers.

    PS C:\Users\sysadmin> get-aduser sysadmin -Properties * | Get-Member -MemberType Properties | measure -Line | select lines
    
    Lines
    -----
      117

    Also , should it display the powershell edition as 'Desktop' ? 🙂
    Thank you!

  • #119053

    Participant
    Points: 814
    Helping Hand
    Rank: Major Contributor

    Yes, the edition will show as Desktop even for Server OS

You must be logged in to reply to this topic.