Forum Discussion

hgorina's avatar
hgorina
Frequent Visitor
9 years ago
Solved

active directory SAM (pre-windows 2000 username)

Hello,   I need to retrieve pre-windows 2000 username from Active directory, so I can cross reference it to the data I have from other source.   I know  that it's proper name is SAMAccountName or...
  • hgorina's avatar
    9 years ago

    Figured it out:

    see below  

    substitute BlaBla for your domain name

     

     

    let
    Source = ActiveDirectory.Domains("BlaBla"),
    #"BlaBla" = Source{[Domain="BlaBla"]}[Object Categories],
    user = #"BlaBla"{[Category="user"]}[Objects],
    #"Expanded top" = Table.ExpandRecordColumn(user, "top", {"msDS-PrincipalName"}, {"top.msDS-PrincipalName"})
    in
    #"Expanded top"