Solved

Computer Description Permission of Domain user

Posted on 2009-07-12
5
1,125 Views
Last Modified: 2012-05-07
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?

0
Comment
Question by:Angguen
5 Comments
 
LVL 6

Expert Comment

by:ou_dober
ID: 24834887
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
0
 
LVL 23

Expert Comment

by:ComputerTechie
ID: 24836969
You can also try using this tool.

http://www.jdhitsolutions.com/logonscriptgen/index.htm

CT
0
 
LVL 2

Author Comment

by:Angguen
ID: 24836997
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.
0
 
LVL 83

Expert Comment

by:oBdA
ID: 24839766
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
0
 
LVL 3

Accepted Solution

by:
gs121 earned 500 total points
ID: 24854027
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

       
    Else

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

       objUser.Description = strMessage1
       objUser.SetInfo

       objComputer.Description = strMessage2
       objComputer.SetInfo

    End If
0

Featured Post

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
sql query 3 47
Outlook.com, live.com spam problem 4 57
Check Disk (CHKDSK) on all volumes and fix if needed. 8 188
Safe to delete the DataStore.edb on a Win 7 computer? 4 140
This article covers how to install the Microsoft Windows Operating System (OS). What is covered in this article:  > Different Versions and Editions of the Windows OS  > Upgrading versus Fresh Installation of the OS           - Steps to take pr…
The way I use Experts Exchange to assist me in analyzing and diagnosing a problem is I first enter a Verbose Question at Experts Exchange like: Office 2007 will hang when opening and saving files I then launch WordPad (any text editor will do) an…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question