Updating AD computer object with user login information

canderso
New Contributor

Does anyone have a login script that will update the computers AD object with username and a time stamp? My Mac scripting skills are not up to par.

7 REPLIES 7

mm2270
Legendary Contributor III

Could you explain more precisely what you're looking for here?

whaking2k
New Contributor

Are you trying to have the user info added to JSS?

canderso
New Contributor

On our Windows computers, when a user logs in a script runs that updates the AD computer object's Description field with the user's username, a time stamp, IP address and other information. We want to replicate that with our Macs.

I have been playing with the dscl command all day but can't seem to get it to update the computer objects description field.

mm2270
Legendary Contributor III

Hmm. I'm not sure you'll be able to get that to work. Although some people have been successful in updating fields in AD using dscl, its not really the tool for the job, so any success you have may be limited or short lived. I don't have much of a suggestion for you unfortunately, because we don't do anything like that. Personally, trying to modify AD records in a script run from a client system doesn't sound like a great idea to me.

But just for kicks, what is the exact field name or names that you're trying to make the changes to? I just looked at my own computer record in AD using dscl and I'm not seeing anything that looks like a description. is it a custom field?

canderso
New Contributor

It appears that the field is called Comment in dscl

whaking2k
New Contributor

Keep us posted if you find something. I could use that in my environment.

Graeme
Contributor

As an alternative I have worked in schools where a login script appended the information to the end of a text file in a hidden share. Not the most secure option but worked well as it keep a history.

Regards
Graeme