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 to edit description field in AD

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

Logged in as: Guest
  Printable Version
All Forums >> [Scripting Technologies] >> VB Script >> Script to edit description field in AD Page: [1]
Login
Message << Older Topic   Newer Topic >>
Script to edit description field in AD - 5/16/2008 7:14:56 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 to edit description field in AD - 8/11/2008 12:26:19 PM   
dstein


Posts: 618
Score: 5
Joined: 3/12/2003
From: Virginia, USA
Status: offline
Have you looked at this? http://www.microsoft.com/technet/scriptcenter/resources/qanda/apr05/hey0429.mspx

_____________________________

software is squishy-squashy, hardware is wishy-washy

(in reply to jtralala)
Post #: 2
RE: Script to edit description field in AD - 8/11/2008 1:52:14 PM   
gkamenjati


Posts: 108
Score: 0
Joined: 6/8/2005
From: San Jose, California
Status: offline
Dave's link is what we've used in our systems, but we disabled the user side, and just edited the machine 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

(in reply to dstein)
Post #: 3
Page:   [1]
All Forums >> [Scripting Technologies] >> VB Script >> Script to edit description field 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.250