Re: I want to add fields to user report

From: Torgeir Bakken \(MVP\) (Torgeir.Bakken-spam_at_hydro.com)
Date: 03/17/05


Date: Thu, 17 Mar 2005 21:20:12 +0100

Randy Reimers wrote:

> I have a script that helps me document my part of Active Directory. The
> existing script works well, but I would like to add some more fields to it.
> We are in a native mode 2003 AD forest. I would like to add these:
> When created

The whenCreated attribute:
http://groups.google.co.uk/groups?as_q=CreateObject%20whenCreated%20%20LDAP&safe=images&as_scoring=d&lr=&hl=en

> Last logon

You need to connect to all domain controllers (unless using the
LastLogonTimestamp described further down).

More here:

http://www.rlmueller.net/Last%20Logon.htm

If your domain functional level has been set to Windows Server 2003,
there is an alternative value you can use (that is replicated, but
will only give you one week intervals on the value):

 From the docs:

http://www.microsoft.com/resources/documentation/WindowsServ/2003/enterprise/proddocs/en-us/dsadmin_concepts_accounts.asp

<quote>
When the domain functional level has been set to Windows Server 2003,
a new lastLogonTimestamp attribute is used to track the last logon
time of a user or computer account.
</quote>

Last-Logon-Timestamp attribute [AD Schema]
http://msdn.microsoft.com/library/en-us/adschema/adschema/a_lastlogontimestamp.asp

<quote>
Last-Logon-Timestamp
This is the time that the user last logged into the domain. This value
is only updated when the user logs in if a week has passed since the
last update. This value is replicated.
</quote>

The above is relevant for both user and computer accounts. Note the
once a week update only part and the Windows Server 2003 domain
functional level prerequisite.

> Profile path for Terminal services
> Terminal services Home folder

If you can run your script from a Windows 2003 Server:

List Terminal Services Properties for a User
http://www.microsoft.com/technet/scriptcenter/scripts/ts/users/tsusvb07.mspx

If a Windows 2003 Server is not an option, a 3rd party free DLL that
can help you here is EOLWTSCOM.dll:

http://groups.google.co.uk/groups?selm=3E4A9464.DD8B201B%40hydro.com

-- 
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx


Relevant Pages

  • Re: Windows 2003 Last Login
    ... >> lastlogin time field only updates every 7 days. ... the domain functional level needs to have been set to Windows ... > When the domain functional level has been set to Windows Server 2003, ... > torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway ...
    (microsoft.public.scripting.vbscript)
  • Re: How to find "LastLogonTime" for users
    ... Mueller [MVP] and I actually have some queries. ... if the domain functional level is set to Windows Server ... > torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway ...
    (microsoft.public.windows.server.scripting)
  • Re: Printer Admin Object
    ... and ports on local and remote computers. ... Add and delete a local or remote printer. ... Instrumentation scripts in Windows Server 2003, ... -- torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: ...
    (microsoft.public.scripting.vbscript)
  • Re: Windows 2003 Last Login
    ... The WinNT property LastLogin that you use is updated at each user logon ... the domain functional level needs to have been set to Windows ... When the domain functional level has been set to Windows Server 2003, ... -- torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: ...
    (microsoft.public.scripting.vbscript)
  • Re: auto shutdown
    ... script will do a reboot of the remote computer. ... If you want a forced shutdown, ... You can find peer-to-peer support for Scripting technologies in the Windows Server Scripting newsgroup. ...
    (microsoft.public.windowsxp.basics)

Loading