cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
christopher_ric
Engaged Sweeper
Hello - I'm trying to pull a report to grab the extensionAttribute1 field in our AD user table:

I don't see an option to select it in the Report builder in Lansweeper. Here is what I currently have setup:

Select Top 1000000 tblADusers.OU,
tblADusers.Country,
tblADusers.Username,
tblADusers.email,
tblADusers.Lastname,
tblADusers.Firstname,
tblADusers.EmployeeID,
tblADusers.Telephone,
tblADusers.Title,
tblADObjects.sAMAccountName As ManagerName
From tblADObjects
Right Join tblADusers On tblADObjects.ADObjectID =
tblADusers.ManagerADObjectId
Order By tblADusers.Username

In Active Directory, It is labeled under the Attribute Editor tab, then under extensionAttribute1 field. I'd like to get the value of that field.

Thanks!


1 ACCEPTED SOLUTION
Daniel_B
Lansweeper Alumni
We only pull a limited number of properties from AD computer and user accounts. ExtensionAttributes won't get scanned by default. The only way of pulling reports on that is using openQuery and directly querying your Active Directory. That is possible if your database is running on SQL Server Express or higher edition.

View solution in original post

2 REPLIES 2
Daniel_B
Lansweeper Alumni
We only pull a limited number of properties from AD computer and user accounts. ExtensionAttributes won't get scanned by default. The only way of pulling reports on that is using openQuery and directly querying your Active Directory. That is possible if your database is running on SQL Server Express or higher edition.
harringg
Champion Sweeper
I don't know if that attribute is scanned in LS or not.

I don't see it tblADUsers.

I use that attribute field too and here is a basic Powershell script that will give you what you want.

Depending on your OU structure, change the value in [1]

$aduserinfo = get-aduser -Identity "grant.harrington" -Properties *
$ou = $aduserinfo.distinguishedname.split(",")[1]

$ou = $ou.substring(3)

$ADUserProps = [ordered]@{
'OU' = $ou
'Country' = $aduserinfo.Country
'UserName' = $aduserinfo.Name
'EmailAddress' = $aduserinfo.EmailAddress
'Surname' = $aduserinfo.Surname
'GivenName' = $aduserinfo.GivenName
'Employee ID' = $aduserinfo.extensionAttribute1
'TelephoneNumber' = $aduserinfo.telephoneNumber
'Title' = $aduserinfo.Title
'sAMAccountName' = $aduserinfo.SamAccountName
}
$ADUserObj = New-Object -TypeName PSObject -Property $ADUserProps
Write-output $ADUserObj