Notification

Icon
Error

Custom attributes from AD

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

Arron

Member Original PosterPosts: 5
2
Like
Hello,

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?

Thanks,
Arron.
SouthySuper
#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.
Bruce.B
#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.
Gyorvari
#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)

Const ADS_SCOPE_SUBTREE = 2
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
objRecordSet.MoveFirst
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."
Else
objShell.Popup "Password sent to clipboard " & objToFind & ": " & objProperty
QuickClip(objProperty)
End If
'Wscript.Quit
End If
objRecordSet.MoveNext
Loop
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





dhoward
#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 uVNC Portable (trying to replace LSRemote)
by  CyberCitizen   Go to last post Go to first unread
Last post: 6/15/2021 11:40:21 PM(UTC)
Action Password Status
by  steveb  
Go to last post Go to first unread
Last post: 5/20/2021 5:24:13 PM(UTC)
Action Remote Uninstaller
by  Tyler M.   Go to last post Go to first unread
Last post: 5/19/2021 4:34:20 PM(UTC)
Lansweeper Verify a successful copy to user computer
by  Brandon  
Go to last post Go to first unread
Last post: 4/22/2021 9:09:50 PM(UTC)
Lansweeper Pablo
by  Pablo   Go to last post Go to first unread
Last post: 4/20/2021 8:05:07 PM(UTC)
Lansweeper Can Actions work when using when using a Ubuntu machine
by  mzipperer  
Go to last post Go to first unread
Last post: 4/1/2021 10:16:34 PM(UTC)
Lansweeper Remove user from local admin group
by  jhartley@alcona-county.net   Go to last post Go to first unread
Last post: 3/24/2021 4:27:30 PM(UTC)
Lansweeper Network Scanning
by  MZU  
Go to last post Go to first unread
Last post: 3/7/2021 8:23:10 AM(UTC)