Posted on 09-25-2014 09:44 AM
Hi everyone,
We were successfully able to implement GPO (via this article https://jamfnation.jamfsoftware.com/article.html?id=85) to bring our domain joined (bound) Windows computers to the JSS for inventory purposes.
And even though, in "Computer Inventory Collection", the "Collect user and location information from LDAP" is abled, the user and location info is not being collected when the Windows computers are reporting to the JSS.
LDAP seems to be working fine, because if I go to the "User and Location" section for any computer and do a "Look up in LDAP", user and location info is pulled without any issues.
So, I have a bunch of Windows computers in our inventory but no user and location info assigned.
Any ideas on how to make this work, so that when Windows computers report via the GPO, the user and location info is also collected through this process.
Thank you.
Posted on 09-26-2014 01:16 PM
The below is how to do it on a mac,
http://macmule.com/2014/05/04/submit-user-information-from-ad-into-the-jss-at-login-v2/
I wonder if the $3 option mentioned would work on PC's too?
Posted on 09-29-2014 01:43 PM
Thank you for your reply here.
I dug deeper and found out the GPO is being setup and ran with the script below, which I took your $3 suggestion and insert it where the user name is called... similar how you have it outlined in your article. However, it is still not pulling the user and location info from LDAP.
I'm posting the script in case you or someone have any ideas or directions.
Thank you.
Again, below is the script:
On Error Resume Next
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("wscript.shell")
Set objShellApp = CreateObject("Shell.Application")
Set environmentVar = objShell.Environment("PROCESS")
set objNetwork = createobject("wscript.network")
strADsPath = getUser(objNetwork.Username)
set objUser = GetObject(strADsPath)
jamfDir = "C:DriversScriptsRecon"
jssAddress="https://myjss.com:8443/"
username=“user”
password=“password"
runReconCommand = """"&jamfDir&"jamf.exe"&""""&" recon -overrideJSS " & jssAddress & " -username " & username & " -password "& password &" -email " & objUser.mail & " -room " & objUser.physicalDeliveryOfficeName & " -endUsername " & objuser.sAMAccountName
Set oExec=objShell.Exec(runReconCommand)
Function getUser(Byval UserName) DIM objRoot DIM getUserCn,getUserCmd,getUserRS on error resume next set objRoot = getobject("LDAP://RootDSE") set getUserCn = createobject("ADODB.Connection") set getUserCmd = createobject("ADODB.Command") set getUserRS = createobject("ADODB.Recordset") getUserCn.open "Provider=ADsDSOObject;" getUserCmd.activeconnection=getUserCn getUserCmd.commandtext="<LDAP://" & objRoot.get("defaultNamingContext") & ">;" & "(&(objectCategory=user)(sAMAccountName=" & username & "));" & "adsPath;subtree"
set getUserRs = getUserCmd.execute if not rs.BOF and not rs.EOF then getUserRs.MoveFirst getUser = getUserRs(0) else getUser = "" end if
getUserCn.close
end function