Listing User Login Scripts

G

Guest

Is there a simple way to export a list of all users and their associated
login scripts? I've looked into filtering ADUC, but don't see the field
listed. I also found a script in the TechNet script repository that would
return the login script value for a given user, but that's not any better
than going to each account!

Thanks in advance!
 
D

David Denmark

LSI said:
Is there a simple way to export a list of all users and their
associated login scripts? I've looked into filtering ADUC, but don't
see the field listed. I also found a script in the TechNet script
repository that would return the login script value for a given user,
but that's not any better than going to each account!

Thanks in advance!

Greetings,

The User Management Resource Administrator can quickly export this user &
login script information for you. With the UMRA, you can create a visual
script that will go out to Active Directory and prepare a CSV file showing
all users with their associated login script. You can list other attributes
as well (description, manager, home directory, global group memberships,
email address, etc). You can download a trial-version of the software at
www.advtoolware.com.

How many users do you have to export this information for?


Thanks,

Dave Denmark
Advanced Toolware
Phone: 1-888-770-4242 Ext. 108
Phone: (253) 770-4823
Fax: (253) 435-4966
Email: (e-mail address removed)
http://www.AdvToolware.com

--- TOOLS FOR WIN 2003/2000/NT/XP ---
* Network and Event Log Monitoring
* Server and Domain Management
* User Account Management
* Disk Quota Management
 
G

Guest

About 250.

David Denmark said:
Greetings,

The User Management Resource Administrator can quickly export this user &
login script information for you. With the UMRA, you can create a visual
script that will go out to Active Directory and prepare a CSV file showing
all users with their associated login script. You can list other attributes
as well (description, manager, home directory, global group memberships,
email address, etc). You can download a trial-version of the software at
www.advtoolware.com.

How many users do you have to export this information for?


Thanks,

Dave Denmark
Advanced Toolware
Phone: 1-888-770-4242 Ext. 108
Phone: (253) 770-4823
Fax: (253) 435-4966
Email: (e-mail address removed)
http://www.AdvToolware.com

--- TOOLS FOR WIN 2003/2000/NT/XP ---
* Network and Event Log Monitoring
* Server and Domain Management
* User Account Management
* Disk Quota Management
 
D

David Denmark

Hi LSI,

The UMRA can do that in about 5 seconds. Here's a howto article on what you
need to do in order to generate & run this script:

To create a script to export user information, simply create a new Mass
project and drag in the following script actions:

1. Get User (AD)
2. Get Attribute (AD)
3. Export Variables

To bring in a list of users to gather this information for, simply switch
over to the Network tab (down in the lower left), expand out your domain,
then locate "All users" and right-click and hit Display. This will bring in
a list of all users inside your domain.

Next you must link the imported network data with your script; we do this by
assigning variables to columns inside the Network Data tab. Right-click on
the header for the column listing the User Name and choose Properties. In
the Variable box, enter %UserName% and click OK.

Then go back to your Script tab and set up your Get User (AD) action to
reference your Domain & User Name. Double-click on the Domain property and
enter your domain name (either DNS [domain.local] or NetBIOS [DOMAIN] will
work). Then clear the %FullName% property by right-clicking on it and choose
Clear property data. You should only have the Domain & UserName property
specified, with the %UserName% variable listed for the username.

Set up the Get Attribute (AD) action to reference the %UserObject% and the
'scriptPath' LDAP attribute display name. Set the attribute value output to
the %ScriptPath% variable (replacing %AttributeValue%).

Last, configure your export variables to export the %UserName% &
%ScriptPath% variables. Double-click on the Export Variables action and list
those two variables on the left-hand side of the properties window. Be sure
to specify a file name on the top right-hand side.

To run your script, click on the Network Data tab and click the Run button
at the top. That should go out and get the user from Active Directory,
locate the login script and store it in a variable, then export all
variables to a CSV file for you to review. The UMRA will do this for all
users imported on the Network data tab.

Give us a call if you need further support information.


Thanks,

Dave Denmark
Advanced Toolware
Phone: 1-888-770-4242 Ext. 108
Phone: (253) 770-4823
Fax: (253) 435-4966
Email: (e-mail address removed)
http://www.AdvToolware.com

--- TOOLS FOR WIN 2003/2000/NT/XP ---
* Network and Event Log Monitoring
* Server and Domain Management
* User Account Management
* Disk Quota Management
 
G

Guest

How much does this utility cost?

David Denmark said:
Hi LSI,

The UMRA can do that in about 5 seconds. Here's a howto article on what you
need to do in order to generate & run this script:

To create a script to export user information, simply create a new Mass
project and drag in the following script actions:

1. Get User (AD)
2. Get Attribute (AD)
3. Export Variables

To bring in a list of users to gather this information for, simply switch
over to the Network tab (down in the lower left), expand out your domain,
then locate "All users" and right-click and hit Display. This will bring in
a list of all users inside your domain.

Next you must link the imported network data with your script; we do this by
assigning variables to columns inside the Network Data tab. Right-click on
the header for the column listing the User Name and choose Properties. In
the Variable box, enter %UserName% and click OK.

Then go back to your Script tab and set up your Get User (AD) action to
reference your Domain & User Name. Double-click on the Domain property and
enter your domain name (either DNS [domain.local] or NetBIOS [DOMAIN] will
work). Then clear the %FullName% property by right-clicking on it and choose
Clear property data. You should only have the Domain & UserName property
specified, with the %UserName% variable listed for the username.

Set up the Get Attribute (AD) action to reference the %UserObject% and the
'scriptPath' LDAP attribute display name. Set the attribute value output to
the %ScriptPath% variable (replacing %AttributeValue%).

Last, configure your export variables to export the %UserName% &
%ScriptPath% variables. Double-click on the Export Variables action and list
those two variables on the left-hand side of the properties window. Be sure
to specify a file name on the top right-hand side.

To run your script, click on the Network Data tab and click the Run button
at the top. That should go out and get the user from Active Directory,
locate the login script and store it in a variable, then export all
variables to a CSV file for you to review. The UMRA will do this for all
users imported on the Network data tab.

Give us a call if you need further support information.


Thanks,

Dave Denmark
Advanced Toolware
Phone: 1-888-770-4242 Ext. 108
Phone: (253) 770-4823
Fax: (253) 435-4966
Email: (e-mail address removed)
http://www.AdvToolware.com

--- TOOLS FOR WIN 2003/2000/NT/XP ---
* Network and Event Log Monitoring
* Server and Domain Management
* User Account Management
* Disk Quota Management



About 250.
 
D

David Denmark

For pricing information, please contact our Business Development team at
1-888-770-4242 or drop them an e-mail at sales -at- advtoolware -dot- com.


Thanks,

Dave Denmark
Advanced Toolware
Phone: 1-888-770-4242 Ext. 108
Phone: (253) 770-4823
Fax: (253) 435-4966
Email: (e-mail address removed)
http://www.AdvToolware.com

--- TOOLS FOR WIN 2003/2000/XP/NT ---
* Active Directory User Management
* Server and Domain Management
* Network and Event Log Monitoring
* Disk Quota Management




How much does this utility cost?

David Denmark said:
Hi LSI,

The UMRA can do that in about 5 seconds. Here's a howto article on
what you need to do in order to generate & run this script:

To create a script to export user information, simply create a new
Mass project and drag in the following script actions:

1. Get User (AD)
2. Get Attribute (AD)
3. Export Variables

To bring in a list of users to gather this information for, simply
switch over to the Network tab (down in the lower left), expand out
your domain, then locate "All users" and right-click and hit
Display. This will bring in a list of all users inside your domain.

Next you must link the imported network data with your script; we do
this by assigning variables to columns inside the Network Data tab.
Right-click on the header for the column listing the User Name and
choose Properties. In the Variable box, enter %UserName% and click
OK.

Then go back to your Script tab and set up your Get User (AD) action
to reference your Domain & User Name. Double-click on the Domain
property and enter your domain name (either DNS [domain.local] or
NetBIOS [DOMAIN] will work). Then clear the %FullName% property by
right-clicking on it and choose Clear property data. You should only
have the Domain & UserName property specified, with the %UserName%
variable listed for the username.

Set up the Get Attribute (AD) action to reference the %UserObject%
and the 'scriptPath' LDAP attribute display name. Set the attribute
value output to the %ScriptPath% variable (replacing
%AttributeValue%).

Last, configure your export variables to export the %UserName% &
%ScriptPath% variables. Double-click on the Export Variables action
and list those two variables on the left-hand side of the properties
window. Be sure to specify a file name on the top right-hand side.

To run your script, click on the Network Data tab and click the Run
button at the top. That should go out and get the user from Active
Directory, locate the login script and store it in a variable, then
export all variables to a CSV file for you to review. The UMRA will
do this for all users imported on the Network data tab.

Give us a call if you need further support information.


Thanks,

Dave Denmark
Advanced Toolware
Phone: 1-888-770-4242 Ext. 108
Phone: (253) 770-4823
Fax: (253) 435-4966
Email: (e-mail address removed)
http://www.AdvToolware.com

--- TOOLS FOR WIN 2003/2000/NT/XP ---
* Network and Event Log Monitoring
* Server and Domain Management
* User Account Management
* Disk Quota Management



About 250.

:

LSI wrote:
Is there a simple way to export a list of all users and their
associated login scripts? I've looked into filtering ADUC, but
don't see the field listed. I also found a script in the TechNet
script repository that would return the login script value for a
given user, but that's not any better than going to each account!

Thanks in advance!

Greetings,

The User Management Resource Administrator can quickly export this
user & login script information for you. With the UMRA, you can
create a visual script that will go out to Active Directory and
prepare a CSV file showing all users with their associated login
script. You can list other attributes as well (description,
manager, home directory, global group memberships, email address,
etc). You can download a trial-version of the software at
www.advtoolware.com.

How many users do you have to export this information for?


Thanks,

Dave Denmark
Advanced Toolware
Phone: 1-888-770-4242 Ext. 108
Phone: (253) 770-4823
Fax: (253) 435-4966
Email: (e-mail address removed)
http://www.AdvToolware.com

--- TOOLS FOR WIN 2003/2000/NT/XP ---
* Network and Event Log Monitoring
* Server and Domain Management
* User Account Management
* Disk Quota Management
 
J

Joe Richards [MVP]

(all one line)

adfind -b domain_dn -f "&(objectcategory=person)(objectclass=user)"
scriptpath

If you have a single domain, this could be simplified to

adfind -default -f "&(objectcategory=person)(objectclass=user)" scriptpath

If you want it in csv format you can add -csv.

joe


--
Joe Richards Microsoft MVP Windows Server Directory Services
Author of O'Reilly Active Directory Third Edition
www.joeware.net


---O'Reilly Active Directory Third Edition now available---

http://www.joeware.net/win/ad3e.htm
 
R

Randy Reimers

Or, for free - this script was started by Richard Mueller, and I added a LOT
to it. This will create a spreadsheet with a lot of information for you. We
use it to document out OU structure, and check out consistencies of use.
This starts at a defined OU, and creates tabs for each OU under that that
contains users.

To use:
In line 31, change the file save locatioon and name to where and what you
want
In line 36 and 37, change the numbers of spreadsheets to fit your need - if
you don't need nore than 3, comment out 35- 40
In 41, set for the domain, and starting OU
Save, and run.

Any questions, feel free to ask he.re

--------------CreateUserListExcel.vbs-------------------------

' CreateUserList3.vbs
' VBScript program to create a Microsoft Excel spreadsheet documenting
' all users in the domain.
'
' ----------------------------------------------------------------------
' Copyright (c) 2002 Richard L. Mueller
' Version 1.0 - November 12, 2002
' Version 1.1 - February 19, 2003 - Standardize Hungarian notation.
' This program enumerates all users in the domain and writes each user's
' LDAP DistinguishedName to a Microsoft Excel spreadsheet.
'
' You have a royalty-free right to use, modify, reproduce, and
' distribute this script file in any way you find useful, provided that
' you agree that the copyright owner above has no warranty, obligations,
' or liability for such use.
' Rewritten by Randy Reimers to add fields and save to Excel

'Option Explicit

Dim strExcelPath, oDomain, oContainer, usr, usrDN
Dim objRecordSet, strDN, objExcel, objSheet, oObj, sClass, subPath, NTDomain
Dim intIndex, k, sheet, strSheet, objWorkBook, i, objConnection, objCommand
Dim strFilter, strValue, strQuery

k = 2
sheet = 1
strFilter = "(&(objectCategory=person)(objectClass=user))"
strValue = ";DistinguishedName,Name"

' Spreadsheet file to be created.
strExcelPath = "F:\UserListWG.xls"

' Bind to Excel object.
Set objExcel = CreateObject("Excel.Application")
Set objWorkBook = objExcel.Workbooks.Add 'new
If objWorkBook.Sheets.Count < 18 then
For i = objWorkBook.Sheets.Count to 20
objWorkBook.Sheets.Add()
Next
End if
Set oDomain = GetObject("LDAP://OU=WG,dc=corp,dc=inet")

' Use ADO to search the domain for all users.
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOOBject"
objConnection.Open "Active Directory Provider"
Set objCommand.ActiveConnection = objConnection

EnumOU(oDomain)

' Save the spreadsheet.
objExcel.ActiveWorkbook.SaveAs strExcelPath
objExcel.ActiveWorkbook.Close

' Quit Excel.
objExcel.Application.Quit

' Clean up.
Set objRecordSet = Nothing
Set objSheet = Nothing
Set objExcel = Nothing

MsgBox "Done"

Wscript.Quit

Function EnumOU(oContainer)
For Each oObj In oContainer
For Each sClass in oObj.ObjectClass
If LCase(sClass) = "organizationalunit" Then
subPath=oObj.AdsPath
' wscript.echo subPath
Call newSheet(subPath, sheet)
EnumOUT(subPath)
sheet = sheet + 1
If k = 2 Then
sheet = sheet - 1
End If
k = 2
End If
Next
Next
End Function

Function EnumOUT(oContainer)

strQuery = "<" & oContainer & ">;" & strFilter & strValue & ";subtree"

objCommand.CommandText = strQuery
objCommand.Properties("Page Size") = 500
objCommand.Properties("Timeout") = 30
objCommand.Properties("Cache Results") = False
objCommand.Properties("Sort on") = "Name"

Set objRecordSet = objCommand.Execute
Do Until objRecordSet.EOF

usrDN = ""

On Error Resume Next

usrDN = objRecordSet.Fields("distinguishedName")
Set objItem = GetObject("LDAP://" & usrDN)
intIndex = InStr(usrDN, "OU=")
usrDN = Mid(usrDN, intIndex)

'objSheet.Cells(k, 1).Value = objRecordSet.Fields("name")
objSheet.Cells(k, 1).Value = objItem.cn
objSheet.Cells(k, 2).Value = objItem.sAMAccountName
objSheet.Cells(k, 3).Value = objItem.ScriptPath
objSheet.Cells(k, 4).Value = usrDN
objSheet.Cells(k, 5).Value = objItem.Description
objSheet.Cells(k, 6).Value = objItem.WhenChanged
objSheet.Cells(k, 7).Value = objItem.WhenCreated
If objItem.TerminalServicesProfilePath <> "" Then
objSheet.Cells(k, 8).Value = objItem.TerminalServicesProfilePath
objSheet.Cells(k, 9).Value = objItem.TerminalServicesHomeDrive & " = " &
objItem.TerminalServicesHomeDirectory
End If

objSheet.Cells(k, 10).Value = objItem.PhysicalDeliveryOfficeName
objSheet.Cells(k, 11).Value = objItem.StreetAddress
objSheet.Cells(k, 12).Value = objItem.L
objSheet.Cells(k, 13).Value = objItem.St
objSheet.Cells(k, 14).Value = objItem.PostalCode
objSheet.Cells(k, 15).Value = objItem.TelephoneNumber
objSheet.Cells(k, 16).Value = objItem.Title
objSheet.Cells(k, 17).Value = objItem.Department
objSheet.Cells(k, 18).Value = objItem.Company


k = k + 1

objRecordSet.MoveNext
Loop

End Function

' Enumerate all users. Write each user's information to the
' spreadsheet.

Function newSheet(subPath, sheet)
strSheet = Mid(subPath,11)
intIndex = InStr(strSheet, "OU=")
strSheet = Left(strSheet, intIndex - 2)
' Bind to worksheet.
'wscript.Echo sheet & " " & strSheet
Set objSheet = objExcel.ActiveWorkbook.Worksheets(sheet)
objSheet.Name = strSheet
objSheet.Cells(1, 1).Value = "User Distinguished Name"
objSheet.Cells(1, 2).Value = "Logon ID"
objSheet.Cells(1, 3).Value = "Logon Script"
objSheet.Cells(1, 4).Value = "User's OU"
objSheet.Cells(1, 5).Value = "Description"
objSheet.Cells(1, 6).Value = "Changed"
objSheet.Cells(1, 7).Value = "Created"
objSheet.Cells(1, 8).Value = "TS Profile Path"
objSheet.Cells(1, 9).Value = "TS Home Path"
objSheet.Cells(1, 10).Value = "Office"
objSheet.Cells(1, 11).Value = "Street"
objSheet.Cells(1, 12).Value = "City"
objSheet.Cells(1, 13).Value = "State"
objSheet.Cells(1, 14).Value = "ZIP"
objSheet.Cells(1, 15).Value = "Phone"
objSheet.Cells(1, 16).Value = "Title"
objSheet.Cells(1, 17).Value = "Department"
objSheet.Cells(1, 18).Value = "Company"


' Format the spreadsheet.
objSheet.Range("A1:D1").Font.Bold = True
objSheet.Select
objSheet.Range("A2").Select
objExcel.ActiveWindow.FreezePanes = True
objExcel.Columns(1).ColumnWidth = 45
objExcel.Columns(2).ColumnWidth = 26
objExcel.Columns(3).ColumnWidth = 15
objExcel.Columns(4).ColumnWidth = 65
objExcel.Columns(5).ColumnWidth = 20
objExcel.Columns(6).ColumnWidth = 15
objExcel.Columns(7).ColumnWidth = 15
objExcel.Columns(8).ColumnWidth = 30
objExcel.Columns(9).ColumnWidth = 25
objExcel.Columns(10).ColumnWidth = 20
objExcel.Columns(11).ColumnWidth = 25
objExcel.Columns(12).ColumnWidth = 15
objExcel.Columns(15).ColumnWidth = 15
objExcel.Columns(16).ColumnWidth = 25
objExcel.Columns(17).ColumnWidth = 20
objExcel.Columns(18).ColumnWidth = 20

End Function

'These are not used as of yet
Function makedate(dateval)
stryr = Left(dateval,4)
strmo = Mid(dateval,5,2)
strday = Right(dateval,2)
MakeDate = strmo & "/" & strday & "/" & stryr
End Function

Function MakeTime(timeval)
MakeTime = Left(TimeVal,2) & ":" & Right(TimeVal,2)
End Function

--------------CreateUserListExcel.vbs-------------------------end
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top