Link to home
Start Free TrialLog in
Avatar of azstbzimms
azstbzimms

asked on

Logon Script that writes to User's Active Directory Account in the description field not working for all users.

We have a logon script that is applied through a GPO that is supposed to take a user's logon name and the computer name that they logged on to and place that in the description field of the General Tab in each users AD account.  It does the same thing for the Computer Object (Description Field).  The problem that we are having is that the GPO is linked to an OU and only some of the users (in the same OU or container) are getting the description field updated when they logon.  The security filtering is set to authenticated users.  
Any ideas?
''POPULATES AD WITH USER LOGON INFO IN DESCRIPTION FIELD
 
Set objSysInfo = CreateObject("ADSystemInfo")
 
Set objUser = GetObject("LDAP://" & objSysInfo.UserName)
Set objComputer = GetObject("LDAP://" & objSysInfo.ComputerName)
 
strMessage = objUser.CN & " logged on to " & objComputer.CN & " " & Now & "."
 
objUser.Description = strMessage
objUser.SetInfo
 
objComputer.Description = strMessage
objComputer.SetInfo

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Jared Luker
Jared Luker
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of azstbzimms
azstbzimms

ASKER

If I were to delgate domain users or authenticated users, then would it be possible for any user to change the description field of another user's account (using ADUC)?  Would it be better to delegate the group SELF?  I would think the worst case then would that a user could only write to thier own description field.  What do you think?
Agreed... if you can set it up that way it would be better.  I would not be concerned too much with users changing each others description though.  I don't image there are many with ADUC on their systems or would even know what to do with it even if they did.

That and the description gets overwritten every time someone gets logged in.
Ok,  let me see if I can find the correct delagation option to make this happen and test it.
Thanks for your assistance!