Computer Description Permission of Domain user

I have receive a error when i run a Script that quote from technet website(
Windows Script Host
Script:   D:\libarary\Desktop\ComputerDescrition.vbs
Line:     9
Char:    1
Code:    80070005
Source:  Active Directory

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

objComputer.Description = strMessage

It is run success when i log on a computer use Domain Admin,I guess it is  a Domain Permission issue,but how do I give my domain users permission to change the description attribute for their computer?

Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

gs121Connect With a Mentor Commented:
Set up the rights as explained by oBdA:
But I also did the same for the Computer objects, you have to do the rights for the Computer description.
The following script skips the update if the OS is a server OS.  This way citrix server logon etc don't change server descriptions.  Also you can look up users by computer name and also coputers via user name.  I place the full contect of the user name in the description.  You can modify it not give the full contect.

' ********************************************************************
' This script Modifies a User Desscription field and Computer Description
' field in AD with User Name, Computer Name, and Login Date & Time,
' and User Context
' Skips if the computer is running a server version of Windows
' ********************************************************************

on error resume next

Set objSysInfo = CreateObject("ADSystemInfo")
Set objComputer = GetObject("LDAP://" & objSysInfo.ComputerName)
Set objUser = GetObject("LDAP://" & objSysInfo.UserName)

strOS = objComputer.operatingSystem

    If InStr(UCase(strOS),"SERVER")  Then


       strmessage1 = objComputer.CN & ", " & Now &", " & objSysInfo.UserName
       strMessage2 = objUser.CN & ", " & objComputer.CN & ", " & Now & ", " & objSysInfo.UserName

       objUser.Description = strMessage1

       objComputer.Description = strMessage2

    End If

I would suggest running it in the login script via GPO or domain controller so that it will run under the system account of the computer rather than under the users credentials.  If you were going to try let/allow the user to run this you would have to elevate their permissions to power user or local administrator.

Create a login script through a domain controller

Apply login scripts via GPO

Hope this helps.

You can also try using this tool.

AngguenAuthor Commented:
It was run failure still whatever it belong to Power user or local administrator.
I guess Power user or local administrator just is a role of local computer.

thank your replay.
The script is trying to write information into the AD database; local permissions have no meaning there.
To enable users to do that, you'll need to delegate permissions in AD.
Create a domain local group "AD-WriteWSDescription" or whatever.
Add "Domain Users" or another global group that has the users that are supposed to run this script to this group.
Right-click the OU where your workstations accounts (! -- do not delegate from the AD root down!) are and choose "Delegate Permissions" to start the "Delegation of Control" wizard.
Add the "AD-WriteWSDescription" group you've created, then choose "Create a custom task to delegate".
Enable "Only the following objects in the folder" and check "Computer Objects".
Check only "Property specific" in "Show these permissions", and find and check "Write description" in the list box below.
Click Next and Finish.
Appendix G: Active Directory Delegation Tools
All Courses

From novice to tech pro — start learning today.