Custom attributes from AD

Posted: Friday, April 7, 2017 3:20:53 PM(UTC)


Member Original PosterPosts: 5

I would like to know is it possible to pull custom attributes from AD, we plan on using Microsoft LAPS. This will ultimately store the computers local admin password in AD under 2 attributes. I would like to have these appear in LanSweeper against the asset?

#1SouthySuper Member Posts: 41  
posted: 4/7/2017 8:47:06 PM(UTC)
If you go to create a report and do not see those attributes available in tbladobjects then the answer is not yet. I have the same issue with other attributes not seen by LS. One post suggested modifying the database, but I think that is a bad idea as the next update will hose that work if not break lansweeper itself. Plus support would not be able to help you if you monkey with the DB.
#2Bruce.B Member Administration Posts: 563  
posted: 4/10/2017 10:55:50 AM(UTC)
We would indeed not recommend modifying the database by adding tables or fields as this can break your installation and prevent you from updating this installation in the future.

We currently have an active item on our customer wishlist for scanning more AD attributes, and will be scanning more AD attributes in a future Lansweeper release, at this moment we cannot yet provide an estimated release date for this.

As far as custom attribute scanning goes though, this is not yet planned to be added.
#3Gyorvari Member Posts: 2  
posted: 1/25/2018 2:36:44 PM(UTC)
Create a custom action, and use the following code to get LAPS password for your asset.

objToFind = WScript.Arguments.Item(0)
Set objShell = Wscript.CreateObject("Wscript.Shell")

ExecuteSearch = SearchDistinguishedName(objToFind)

Public Function SearchDistinguishedName(ByVal vSAN)

Dim oRootDSE, oConnection, oCommand, oRecordSet

Set oRootDSE = GetObject("LDAP://rootDSE")
Set oConnection = CreateObject("ADODB.Connection")
oConnection.Open "Provider=ADsDSOObject;"
Set objCommand = CreateObject("ADODB.Command")
objCommand.ActiveConnection = oConnection

ldstring = "'LDAP://" & oRootDSE.get("defaultNamingContext") & "'"

objCommand.CommandText = "Select Name, distinguishedName from "& ldstring & " where objectClass='computer'"

objCommand.Properties("Page Size") = 1000
objCommand.Properties("Timeout") = 30
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
objCommand.Properties("Cache Results") = False
Set objRecordSet = objCommand.Execute
Do Until objRecordSet.EOF
If lcase(objRecordSet.Fields("Name").Value) = lcase(vSan) Then

Set objComputer = GetObject _
("LDAP://" & objRecordSet.Fields("distinguishedName").Value )

objProperty = objComputer.Get("ms-Mcs-AdmPwd")
If IsNull(objProperty) Then
objShell.Popup "The ms-Mcs-AdmPwd has not been set."
objShell.Popup "Password sent to clipboard " & objToFind & ": " & objProperty
End If
End If
End Function

Function QuickClip(input)
If IsNull(input) Then
With CreateObject("HTMLFile")
QuickClip = .parentWindow.clipboardData.getData("Text")
If IsNull(clip) Or IsEmpty(clip) Then : clip = "" : End If : End With
Else : With CreateObject("WScript.Shell")
.Run "mshta javascript:eval(""document.parentWindow.clipboardData.setData('text','" _
& Replace(Replace(input,"'","\\u0027"),"""", "\\u0022") & "');window.close()"")",0,True
End With : End If
End Function

#4dhoward Member Posts: 12  
posted: 5/6/2021 11:10:45 PM(UTC)
We are implementing LAPS over here as well, and would love to see the ability to have Lansweeper scan arbitrary attributes of computer objects within AD.

Active Discussions

Lansweeper Enterprise Options in Menu Bar/Configuration
by  mk@allan   Go to last post Go to first unread
Last post: 6/18/2021 7:38:43 PM(UTC)
Lansweeper No One getting back to me from Lansweeper
by  Kenneth Lindsay  
Go to last post Go to first unread
Last post: 6/18/2021 3:31:06 PM(UTC)
Lansweeper INFO DateTimeService time refresh
by  miharix   Go to last post Go to first unread
Last post: 6/18/2021 10:48:57 AM(UTC)
Lansweeper RPC Unavailable error
by  Greeno  
Go to last post Go to first unread
Last post: 6/17/2021 7:15:07 PM(UTC)
Lansweeper Exclude Search
by  pryan67  
Go to last post Go to first unread
Last post: 6/16/2021 4:01:43 PM(UTC)
Lansweeper Report: All Apple Mac devices with Memory RAM asset
by  gabrielo   Go to last post Go to first unread
Last post: 6/16/2021 3:17:24 PM(UTC)
Lansweeper Does technical support for LS really respond?
by  tosch  
Go to last post Go to first unread
Last post: 6/16/2021 12:48:50 PM(UTC)