myITforum.com Community Forum myITforum.com Community Forum

Home  Forums  Blogs  Live Support chat  Search Articles  Wiki  FAQ  Email Lists  Register  Login  My Profile  Inbox  Address Book  My Subscription  My Forums 

Photo Gallery  Member List  Search  Calendars  FAQ  Ticket List  Log Out

All Forums RSS Feed Subscription:


  


script edit description filed in AD

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
  Printable Version
All Forums >> [Scripting Technologies] >> General Scripting >> script edit description filed in AD Page: [1]
Login
Message << Older Topic   Newer Topic >>
script edit description filed in AD - 5/16/2008 7:18:12 AM   
jtralala

 

Posts: 34
Score: 0
Joined: 5/21/2007
Status: offline
Hi All
I am pretty new with vb scripting and I am not able to create following script I hope someone can help me with that
What I need is a script that changes the description field in AD with following information
Username and officename
I have a txt file with this information see below
Computername:Username:officename
Computername1:U34567:Finance
Computername123:U89045:IT
So what the script needs to do is edit the description filed in AD with that information
For Computername1 description must be U34567 Finance
For Computername2 description must be U89045 IT
etc
I hope someone can help me with this script

THX in advance
J
Post #: 1
RE: script edit description filed in AD - 5/16/2008 2:19:33 PM   
gkamenjati


Posts: 108
Score: 0
Joined: 6/8/2005
From: San Jose, California
Status: offline
Here the script that i use (our needs is to see who logged on when, we also have when logged off)
just copy the text in beteen the bigen and end.

Notice I've remed out the user side of the description, because our Net Admin needs it for managing user info.

i just change the field of the computer description.

All what you have to do is just the red fonts area with what you need to show.

This work came from the script guy of microsoft. just google it.

--> bigen

''GK modified 10 -10 -07
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

<-- end


(in reply to jtralala)
Post #: 2
RE: script edit description filed in AD - 5/16/2008 2:20:24 PM   
gkamenjati


Posts: 108
Score: 0
Joined: 6/8/2005
From: San Jose, California
Status: offline
one more thing we push this thru GPO.

(in reply to gkamenjati)
Post #: 3
RE: script edit description filed in AD - 5/19/2008 4:24:57 AM   
jtralala

 

Posts: 34
Score: 0
Joined: 5/21/2007
Status: offline
Thx you
I will test this next week when I am back in the office

Have you placed this script as a startup script fot the users

Thx
J

(in reply to gkamenjati)
Post #: 4
RE: script edit description filed in AD - 5/19/2008 5:00:49 AM   
jtralala

 

Posts: 34
Score: 0
Joined: 5/21/2007
Status: offline
One more question
You told me that you also have a script for logoff can you please also provide me with taht information

regards,

J

(in reply to jtralala)
Post #: 5
RE: script edit description filed in AD - 5/19/2008 9:55:56 AM   
gkamenjati


Posts: 108
Score: 0
Joined: 6/8/2005
From: San Jose, California
Status: offline
It's the same for the Log Off, just changed the red part.

--> bigen

''GK modified 10 -10 -07
Set objSysInfo = CreateObject("ADSystemInfo")
Set objUser = GetObject("LDAP://" & objSysInfo.UserName)
Set objComputer = GetObject("LDAP://" & objSysInfo.ComputerName)
strMessage = objUser.CN & " logged Off " & objComputer.CN & " " & Now & "."
'''objUser.Description = strMessage
'''objUser.SetInfo
objComputer.Description = strMessage
objComputer.SetInfo

<-- end

(in reply to jtralala)
Post #: 6
RE: script edit description filed in AD - 5/19/2008 10:04:22 AM   
gkamenjati


Posts: 108
Score: 0
Joined: 6/8/2005
From: San Jose, California
Status: offline
In our Case both, logon and log Off descriptions are on the computer Side, because we do not want to change the User Description.See below. Computer Configuration (Enabled)Windows SettingsShutdown




Name
Parameters

\\srvdc\NETLOGON\OA-Logon\LoggedOff_description.vbs




 

Administrative Templates
System/Logon




Policy
Setting




To use this setting, click Show, click Add, and then, in the text box, type the name of the executable program (.exe) file or document file. Unless the file is located in the %Systemroot% directory, you must specify the fully qualified path to the file.Note: This setting appears in the Computer Configuration and User Configuration folders. If both settings are configured, the system starts the programs specified in the Computer Configuration setting just before it starts the programs specified in the User Configuration setting.Also, see the &quot;Do not process the legacy run list&quot; and the &quot;Do not process the run once list&quot; settings." gpmc_supported="At least Microsoft Windows 2000">Run these programs at user logon
Enabled









Items to run at logon

\\srvdc\netlogon\oa-logon\change_computer_description.vbs

(in reply to gkamenjati)
Post #: 7
RE: script edit description filed in AD - 5/22/2008 3:17:15 AM   
jtralala

 

Posts: 34
Score: 0
Joined: 5/21/2007
Status: offline
Thx

It works perfect

J

(in reply to gkamenjati)
Post #: 8
Page:   [1]
All Forums >> [Scripting Technologies] >> General Scripting >> script edit description filed in AD Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts



  
Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

0.344