Link to home
Start Free TrialLog in
Avatar of Angguen
AngguenFlag for China

asked on

Computer Description Permission of Domain user

Hi,all
I have receive a error when i run a Script that quote from technet website(http://www.microsoft.com/technet/scriptcenter/resources/qanda/apr05/hey0429.mspx)
Error:
Windows Script Host
Script:   D:\libarary\Desktop\ComputerDescrition.vbs
Line:     9
Char:    1
Code:    80070005
Source:  Active Directory

Script:
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

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?

Avatar of ou_dober
ou_dober
Flag of United States of America image

Anqquen,

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

http://www.sophos.com/support/knowledgebase/article/13273.html

http://technet.microsoft.com/en-us/library/cc758918%28WS.10%29.aspx

Apply login scripts via GPO

http://www.computerperformance.co.uk/Logon/logon_script_assign.htm

http://www.petri.co.il/setting-up-logon-script-through-gpo-windows-server-2008.htm

Hope this helps.

ou_dober
Avatar of Angguen

ASKER

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.
Avatar of oBdA
oBdA

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
http://technet.microsoft.com/en-us/library/cc756087(WS.10).aspx
ASKER CERTIFIED SOLUTION
Avatar of gs121
gs121
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