Re: VBScript to update Computer Description with username and department

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Steve Seguis [MVP] (steve_NO_SPAM_at_scriptmation.com)
Date: 01/28/05


Date: Fri, 28 Jan 2005 23:24:05 GMT

Thiscomp essentially holds a reference to the computer object in
ActiveDirectory whereas oUser is a reference to the user object. As far as
books are concerned, I like the "Windows 2000 Scripting Guide" from
Microsoft Press.

-- 
Steve Seguis - MCSE, MVP Windows Server, SCJP
SCRIPTMATION
Automating the Enterprise
http://www.scriptmation.com
"Lexxus" <JBDanford2002@yahoo.com> wrote in message 
news:1106923633.154387.4030@z14g2000cwz.googlegroups.com...
> Thanks Steve that worked out great. This is what I finally came up
> with.
> Dim adsinfo,nw
> Set adsinfo = CreateObject("adsysteminfo")
>
> Set ThisComp = GetObject("LDAP://" & adsinfo.ComputerName)
> Set oUser = GetObject("LDAP://" & adsinfo.UserName)
> wscript.echo oUser.department & " - " & ouser.description & " " &
> oUser.cn & " " & Ouser.telephonenumber
> Thiscomp.put "description", oUser.department & " - " &
> ouser.description & " " & oUser.cn & " " & Ouser.telephonenumber
> ThisComp.Setinfo
>
> The problem with what you gave me was it was writing the path to the
> the use from Active Directory.
>
> Although through your post I better understand how to pull the info I
> wanted. Do you know of any good books to get for VBScript? or at least
> for doing this kind of stuff. What does the Thiscomp. do? Is that a
> library of commands?
> 


Relevant Pages

  • Re: Looking for a book about C with special criteria
    ... It takes you through a lot of detail about how computers ... a classic work used for reference. ... I wouldn't call TAoCP as mere reference books. ... I was just explaining that *some* programmers ...
    (comp.lang.c)
  • Re: Where to find a COMPLETE VBScript reference?
    ... > Pocket reference book and other books, one which is called "The ULTIMATE ... Since VBS can operate under a number of different hosts and is designed to ... Scripting facilitates other operations. ...
    (microsoft.public.scripting.vbscript)
  • Re: Attn: Gordon: Your "Electronics for Dummies"
    ... They are best suited for an interactive web site that can ... Dead links are the scourge of the Internet. ... but not very good for current reference. ... I think economics demand that reference books die. ...
    (comp.robotics.misc)
  • Re: Trans from ASP to ASP.NET 2.0 via 1.0
    ... As for the reference to a code file, look at the @Page tag at the top of the ... "show code" button when the aspx page is selected. ... books for 2.0. ... I have text-searched the .aspx file for the following strings (case ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Recommended C#/.NET Book
    ... If you are looking for a good langauge/operations reference (which, ... > Here are the books I am considering. ... > Programming Microsoft .NET by Jeff Prosise ... Overrated, lacking advanced subjects including multithreading, etc. ...
    (microsoft.public.dotnet.languages.csharp)