Question

Does a tool exist that can bulk export all users and group memberships in NT4 User Manager to a .csv file?

Asked by: robwhite64

We're in the process of migrating our NT4 domain into one company-wide 2003 AD domain. We need to export a bulk list of our 500 users and their group memberships from User Manager into an Excel spreadsheet. Does a tool exist that can do this? We need a  tool that will do a bulk export, not one computer at a time.

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2007-10-22 at 12:19:27ID22909933
Tags

export

,

users

,

group

Topics

Windows NT Networking

,

Windows 2003 Server

Participating Experts
3
Points
252
Comments
14

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Migrating from NT4 to 2K AD
    We have a simple single NT4 domain called "DOMAIN" with an NT4 PDC and no BDC's. There are a number of Win2K member servers in the Domain running various apps. One of these Win2K member servers currently runs only DHCP, DNS and Anti virus software. As there is no b...
  2. NT4 Domain migration to Win2k AD
    We have an Existing NT4 domain structure with 1 PDC, 3 BDC's, 4 x Exchange 5.5 Servers and 5000 user accounts. The existing PDC's and BDC are used for file-sharing but are too old to run Win2k. Out of the existing 4 Exchange servers one which was the original 5.5 installed se...
  3. Is it possible to carry out a Bulk Update of User Logon Name
    We migrated across from NT4 to 2003 AD a while ago. Most new accounts are created and the user logon name is completed under the account tab. For pre-existing accountsm, only the pre-windows 2000 username is shown. I woul dlike to carry out a bulk update so that the user l...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: bfasonPosted on 2007-10-22 at 12:36:38ID: 20126141

There is a suite of tools that used to be very good at this from pedestal software but they were purchased by Altiris. You can get the trial version at http://www.pedestalsoftware.com/users/index.asp?download=ntsec and the utility you are looking for is ntuser.exe

Hope this helps
B

 

by: oBdAPosted on 2007-10-22 at 12:44:40ID: 20126223

Well, there's addusers.exe (ftp://ftp.microsoft.com/bussys/winnt/winnt-public/reskit/nt40/i386/addusers_x86.exe) which, with a bit of manual work, could do what you require.
But did you have a look at the Active Directory Migration Tool yet?
Active Directory Migration Tool v3.0
http://www.microsoft.com/downloads/details.aspx?FamilyID=6f86937b-533a-466d-a8e8-aff85ad3d212&displaylang=en

 

by: oBdAPosted on 2007-10-22 at 12:48:54ID: 20126257

Just stumbled over another free tool, NTUserExport (http://www.redtiesolutions.com/20901.html), but haven't used it.

 

by: robwhite64Posted on 2007-10-23 at 07:46:23ID: 20131429

Bfason, your link to the ntuser utility takes me directly to the "order free trial software" page, which provides no information about the product. If I run a search on Pedestal for the product it comes back empty. Are you sure it's called ntuser? NT4's Resource Kit contains a tool called ntuser.exe already that's supposed to allow manipulation of user accounts and groups but I've not found any specific info on what types of manipulation are possible.

oBdA, from what I've read about addusers.exe, it appears to be a "one computer at a time" utility rather than a bulk export utility. I would love to be proved wrong on this. We don't really have anyone on staff with the know-how or time to try to force the tool to do something it wasn't designed to do.

As for the Migration Tool, the whole purpose of needing the bulk export is so we can prepare properly prior to doing the migration. However, we would certainly use the Migration Tool in our test environment if it has the ability to pull bulk account and group info into a .csv file for us. Does it do this? I have the 300-page V3MgGuide document already downloaded. What would I search on to find info in there about doing this?

Also, unless I'm reading it wrong, the redtiesolutions product is also a "one computer at a time" utility. Again, please prove me wrong!

 

by: oBdAPosted on 2007-10-23 at 11:01:24ID: 20132977

Run addusers against the DC or the domain name, and it will export the domain users and domain groups.
The same should be true for NTUserExport: "This FREE tool lists users on a local NT/Win2000/XP machine or on an NT/Active Directory domain."
If you have indeed *local* accounts on your domain members, then I'm afraid you'll have to do those one by one (though you can run addusers against a remote machine as well to retrieve local users and groups).
I'm currently not quite sure whether the ADMT can do an export of the domain that is to be migrated, but you can pick which users to migrate, which groups to migrate, whether the passwords should be migrated as well, ...

 

by: robwhite64Posted on 2007-10-23 at 12:42:09ID: 20133890

FYI, NTUserExport is also a "one computer at a time" utility. You must specify the computer name in the command. I'll take a closer look at the adduser.exe tool.

 

by: oBdAPosted on 2007-10-23 at 12:52:42ID: 20133993

Nope; you can connect to a DC/domain as well ...

 

by: bfasonPosted on 2007-10-23 at 13:03:08ID: 20134092

The ntsec download is suite of command line utility to manage NT. You would want to use the NTUser.exe with the "show user" and "show group" options. Here's the help file for the ntuser.exe command to determine if it is what you want.


NTUSER 
NTUSER [parms] NEW <user> [options]
                      CHANGE <user> [options]
                      DELETE <user>
                      SHOW <user | *>
                      RENAME <old_user> <new_user>
                      COPY <orig_user> <new_user> [new_server]
                      GROUPS <user>
                      DUPLICATE DOMAIN <old_domain> <new_domain>
                      DUPLICATE SERVER <old_server> <new_server>
                      [L]GROUP NEW <group> [options]
                      [L]GROUP CHANGE <group> [options]
                      [L]GROUP DELETE <group>
                      [L]GROUP SHOW <group | *>
                      [L]GROUP RENAME <old_group> <new_group>
                      [L]GROUP APPEND <group> <users...>
                      [L]GROUP REMOVE <group> <users...>
                      [L]GROUP DUPLICATE DOMAIN <old_domain> <new_domain>
                      [L]GROUP DUPLICATE SERVER <old_server> <new_server>
                      RIGHTS SHOW <right | *>
                      RIGHTS ADD <right> <user(s) | group(s)>
                      RIGHTS REMOVE <right> <user(s) | group(s)>
                      POLICY [options]
                      HELP OPTIONS
                      HELP FLAGS     (used by -set and -unset)
                      HELP RIGHTS    (used by RIGHTS, -addright and -remright)
                      HELP POLICY    (used by POLICY)
 
Use parms: -s <server> : use as default server.
           -sr <server>: user server to evaluate rights (default same as -s).
           -35         : using NT 3.5 features only
           -ras        : Enable ras features
           -wts        : Enable terminal server features
           -userrights : Show user rights when displaying
           -sam        : get permissions to read the password field
           -nocreate   : don't create missing groups when copying users
           -nogroup    : don't copy group memberships
           -nolocalgroup : don't copy local group memberships
           -details    : display details in wildcard matches
           -csv        : display output in comma-separated-values format
           -std        : redirect stderr to stdout
           -b          : return 0 if no errors or 1 if errors occurred
                         (default is to return number of errors)
           -bw         : return 0 if no matches in where expression or 1 if at least one match was made
 
[L]GROUP means to use GROUP for global groups and LGROUP for local groups
 
 
NTUSER OPTIONS:
 
-full_name <name>
-comment <comment_text>
-usr_comment <comment>
-country_code <number>
-code_page <number>
-primary_group <group_name>
-primary_group_id <group_number>
-home_dir <directory>
-home_dir_drive <drive:>
-script_path <path>
-profile <direcotory>
-workstations <computer_name>
-logon_server <computer_name>
-password <new_password>
-random_password <number of character>
-random_password_show <number of character>
-password_expired <yes|no>
-acct_expires <mm/dd/yyyy [hh:mm]>
-max_storage <amt_disk>
-addright <userright>
-remright <userright>
-rasphone <phone>
-wts_initial_program <path>
-wts_working_directory <dir>
-wts_inherit_initial_program <true-or-false>
-wts_allow_logon <true-or-false>
-wts_timeout_connections <milliseconds>
-wts_timeout_disconnections <milliseconds>
-wts_timeout_idle <milliseconds>
-wts_client_drives <true-or-false>
-wts_client_printers <true-or-false>
-wts_client_default_printer <true-or-false>
-wts_broken_timeout_settings <0 or 1>
-wts_reconnect_settings <0 or 1>
-wts_modemcb_settings <0,1, or 2>
-wts_modemcb_phone <phone-number>
-wts_shadowing_settings <0,1,2,3 or 4>
-wts_profile_path <directory>
-wts_home_dir <directory>
-wts_home_dir_drive <drive:>
-wts_remote_home_dir <true-or-false>
-set <flag>     * -set item can be repeated
-unset <flag>   * -unset item can be repeated
 
 
NTUSER FLAGS:
 
Note: UF_SCRIPT and UF_NORMAL_ACCOUNT are always set if no other flags are specified when adding new accounts.
UF_SCRIPT : The logon script executed. This value must be set for LAN Manager 2.0 or Windows NT.
UF_ACCOUNTDISABLE : The user's account is disabled.
UF_HOMEDIR_REQUIRED : The home directory is required. This value is ignored in Windows NT.
UF_PASSWD_NOTREQD : No password is required.
UF_PASSWD_CANT_CHANGE : The user cannot change the password
UF_LOCKOUT : The account is currently locked out. When changing a user, this value can be cleared to unlock a previously locked account. This value cannot be used to lock a previously unlocked account.
UF_DONT_EXPIRE_PASSWD : Represents the password, which should never expire on the account. This value is valid only for Windows NT.
UF_MNS_LOGON_ACCOUNT : No known description
UF_ENCRYPTED_TEXT_PASSWORD_ALLOWED : Windows 2000. The user's password is stored under reversible encryption in the Active Directory
UF_NOT_DELEGATED : Windows 2000. This account is marked as 'sensitive'; other users cannot act as delegates of this user account.
UF_SMARTCARD_REQUIRED : Windows 2000. This user must logon using a smart card.
UF_TRUSTED_FOR_DELEGATION : Windows 2000. The account is enabled for delegation. This is a security-sensitive setting; accounts with this option enabled should be tightly controlled. This setting allows a service running under the account to assume a client's identity and authenticate as that user to other remote servers on the network.
UF_USE_DES_KEY_ONLY : Windows 2000. Restrict this principal to use only Data Encryption Standard (DES) encryption types for keys.
UF_DONT_REQUIRE_PREAUTH : Windows 2000. This account does not require Kerberos preauthentication for logon.
UF_NORMAL_ACCOUNT : This is a default account type that represents a typical user.
UF_TEMP_DUPLICATE_ACCOUNT : This is an account for users whose primary account is in another domain. This account provides user access to this domain, but not to any domain that trusts this domain. The User Manager refers to this account type as a local user account.
UF_WORKSTATION_TRUST_ACCOUNT : This is a computer account for an Windows NT Workstation or Windows NT Server that is a member of this domain.
UF_SERVER_TRUST_ACCOUNT : This is a computer account for an Windows NT Backup Domain Controller that is a member of this domain.
UF_INTERDOMAIN_TRUST_ACCOUNT : This is a permit to trust account for a Windows NT domain that trusts other domains.
RASPRIV_NoCallback : The user has no call-back privilege.
RASPRIV_AdminSetCallback : The user account is configured to have the administrator set the call-back number.
RASPRIV_CallerSetCallback : The remote user can specify a call-back phone number when dialing in.
RASPRIV_DialinPrivilege : The user has permission to dial in to this server.
 
 
NTUSER RIGHTS:
 
SeInteractiveLogonRight              "Log on locally"
SeNetworkLogonRight                  "Access this computer from network"
SeBatchLogonRight                    "Log on as a batch job"
SeServiceLogonRight                  "Log on as a service"
SeCreateTokenPrivilege               "Create a token object"
SeAssignPrimaryTokenPrivilege        "Replace a process level token"
SeLockMemoryPrivilege                "Lock pages in memory"
SeIncreaseQuotaPrivilege             "Increase quotas"
SeMachineAccountPrivilege            "Add workstations to domain"
SeTcbPrivilege                       "Act as part of the operating system"
SeSecurityPrivilege                  "Manage auditing and security log"
SeTakeOwnershipPrivilege             "Take ownership of files or other objects"
SeLoadDriverPrivilege                "Load and unload device drivers"
SeSystemProfilePrivilege             "Profile system performance"
SeSystemtimePrivilege                "Change the system time"
SeProfileSingleProcessPrivilege      "Profile a single process"
SeIncreaseBasePriorityPrivilege      "Increase scheduling priority"
SeCreatePagefilePrivilege            "Create a pagefile"
SeCreatePermanentPrivilege           "Create permanent shared objects"
SeBackupPrivilege                    "Back up files and directories"
SeRestorePrivilege                   "Restore files and directories"
SeShutdownPrivilege                  "Shut down the system"
SeDebugPrivilege                     "Debug programs"
SeAuditPrivilege                     "Generate security audits"
SeSystemEnvironmentPrivilege         "Modify firmware environment values"
SeChangeNotifyPrivilege              "Bypass traverse checking"
SeRemoteShutdownPrivilege            "Force shutdown from a remote system"
 
 
NTUSER POLICY:
 
-min_password_len <characters>
-max_password_age <seconds>
-min_password_age <seconds>
-force_logoff <yes|no>
-logon_change <yes|no>
-password_complex <yes|no>
-admin_lockout <yes|no>
-store_reversible_password <yes|no>
-password_hist_len <times>
-lockout_duration <seconds>
-lockout_reset <seconds>
-lockout_threshold <number>  This turns on/off lockout (>0 or 0)
-kerb_logon_restrictions <true/false>
-kerb_service_ticket <minutes>
-kerb_user_ticket <hours>
-kerb_user_renew <days>
-kerb_clock_skew <minutes>
                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:

Select allOpen in new window

 

by: robwhite64Posted on 2007-10-24 at 12:52:11ID: 20142333

Thanks guys. I'm a new consultant at this company and am having to wait until I can get access to the PDC to test out your recommendations. Should be soon.

 

by: robwhite64Posted on 2007-10-30 at 07:34:06ID: 20177511

I just wanted to clarify that I'm looking for a tool that can associate group memberships with individual user accounts within the SAM, not just produce a list of existing groups in the SAM. Does the NTSEC utility suite have this capability?

 

by: robwhite64Posted on 2007-10-30 at 08:07:16ID: 20177857

This is the blurb from the download page for NTSEC:

http://www.winsite.com/bin/Info?500000034210

NTSEC is a suite of tools used to manipulate and report on the major
security features in Windows systems: access control lists, policies,
user rights, users, groups, and auditing. NTSEC tools are executed via
the command-line, or from WSH/VBScript via a COM Object, and may be
incorporated in logon scripts, or used to automate large scale system
changes, mass rollouts, domain migration, and many other activities.
All tools support manipulation of computers across the network.

Access control lists on files, directories, the registry, shares, printers,
services and drivers are supported. Reporting features include a query
language for locating objects based on their current security settings and
value, including locating files based on user's effective
access. System account and audit policies may be changed. Full support
for displaying and changing user and group flags, parameters and
membership are included. Clone users and groups, change user rights,
display a user's effective user rights, modify terminal server
parameters and more.

-----------

Based on this description, it looks like it can do what we need. I'm now in the process of working with the Systems Administrator to see when we can test it from our DC.

 

by: SteynskPosted on 2008-11-09 at 00:58:31ID: 22915586

Maybe this is something:

'\\\\\\\\\\\\\\\\\\\\\\\\\\
'\\
'\\    Filter AD groups, select a AD group and make a list of its users
'\\    Frans Erich  16-02-06
'\\
'\\		 Sub :  CheckForUser and GetUserAccount taken from "ADuser" script from Ralph E Montgomery 
'\\		 Function :  SelectBox taken from script from T. Lavedas
'\\    
'\\    Script only works in a domain environment
'\\
'\\\\\\\\\\\\\\\\\\\\\\\
'On Error Resume Next
Dim objGroup, objUser, WshShell, strMessage, strDomain, strUserMail, strRootDSE, strGetUserName, Ouser, fso
Dim objNet, major, minor, ver, strMail, strLogonName, strValue, strDisplayDescription, strDisplayDepartment, strDN
Dim strSearch, strMostRecentIP, aOpt(), intOpt, oGroup, sGroup, txtFile, objComputer
Dim objRootDSE, strTemp, strADsConfPath, strFormat, strFile, i, objConnection, objCommand, objRecordSet, objectRecordSet
Dim strKey, strKeyValue, rval, strBCC, oMailApp, olMailItm, olMailItem, intSize, strDelegateCount
 
Set WshShell = WScript.CreateObject("WScript.Shell")
Set objNet = CreateObject("WScript.Network")
Set objRootDSE = GetObject("LDAP://rootDSE")
strADsConfPath = "LDAP://" & objRootDSE.Get("configurationNamingContext")
strRootDSE = objRootDSE.Get("defaultNamingContext")
strDomain = UCase(objNet.UserDomain)
strSearch = LCase(InputBox("Geef een optionele waarde op waarop u groepen wilt filteren."))
ListGroups( strDomain )
intOpt = 1
'input validation
sGroup = SelectBox("Selecteer een groep", aOpt)
If sGroup = "Selecteer een groep" Then
	strMessage ="U heeft geen keuze gemaakt uit één van de aangeboden groepen."
	Cancelled()
End If
	
' Change the value of variable "strFormat"  beneath to "Outlook" to generate a new mail containing all email addresses of the mebers in the BCC box.
strFormat = "Excel"
 
Set oGroup = GetObject("WinNT://" & strDomain & "/" & sGroup & ",group")
if sgroup <> "Aborted" then
     if sgroup <> "Selecteer een groep" then
            if strFormat = "Excel" then
                 strTemp = WshShell.ExpandEnvironmentStrings("%temp%")
                 strFile = strTemp & "\Ledenlijst " & sgroup & ".csv"
                Set fso = CreateObject("Scripting.FileSystemObject")
              If fso.FileExists(strFile) Then
               fso.DeleteFile(strFile)
              End If 
               Set txtFile = fso.CreateTextFile(strFile)
               i = 0
               For Each oUser In oGroup.Members
               i = i + 1
               strGetUserName=""
               strDN=""
               strMail=""
               strGetUserName= UCase(oUser.Name)
               if mid(strGetUserName,3,1)<>"-" then
        	   CheckForUser()
               	   GetUserAccount(strDN)
               else
               	   strMail = "computer account"
               	   strDisplayDepartment = "computer account"
        	   end if
               txtFile.write (oUser.Name & " ; " & strDisplayDepartment & " ; " & strMail & vbCrLf)
               Next
               txtfile.close
               Set txtfile = nothing
               Set fso = nothing
               strKey = "HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths\Excel.exe\path"
               If KeyExists(strKey) = True Then
                    strKeyValue = WshShell.RegRead(strKey)
                    rval = WshShell.Run(chr(34) & strKeyValue & "excel.exe" & chr(34) & " " & chr(34) & strFile & chr(34) ,1,TRUE) 
               else
                    rval = WshShell.Run("notepad.exe" & " " & strFile,1,TRUE)               
               end if
          else
               For Each oUser In oGroup.Members
               i = i + 1
               strGetUserName=""
               strDN=""
               strMail=""
               strGetUserName= UCase(oUser.Name)
               if mid(strGetUserName,3,1)<>"-" then
        	   CheckForUser()        	   
               	   GetUserAccount(strDN)
               end if
               strBCC = strBCC & strMail &"; " 
               Next
               Set oMailApp = CreateObject("Outlook.Application")
               Set olMailItm = oMailApp.CreateItem(olMailItem)
               olMailItm.BCC = strBCC
               olMailItm.Display
          end if
     end if 
end if
 
Sub CheckForUser()
     Set objConnection = CreateObject("ADODB.Connection")
     objConnection.Provider = ("ADsDSOObject")
     objConnection.Open
     Set objCommand = CreateObject("ADODB.Command")
     objCommand.ActiveConnection = objConnection
     objCommand.CommandText = _
     "<LDAP://" & strRootDSE & ">;(&(objectCategory=user)" & _
     "(samAccountName=" & strGetUserName & "));distinguishedName,sAMAccountName,name;subtree"
     Set objRecordSet = objCommand.Execute
     strDN = objRecordset.Fields("distinguishedName") 
     Set objectRecordSet = Nothing
     objConnection.close
     Set objConnection = Nothing
End Sub
 
Sub GetUserAccount(strDN)
    On Error Resume Next
    If InStr(1,strDN,"/") Then strDN=Replace(strDN,"/","\/")
    Set objUser = GetObject("LDAP://" & strDN & "")
    Set objAdS = GetObject("LDAP://" & strRootDSE & "")
 
    With objUser
        '.GetInfo
        strMail =        .Get("mail")
        strLogonName =   .Get("sAMAccountName")
        strUserMail =    .Get("mail")
        strDescription = .GetEx("description")
        strDepartment =  .GetEx("department")
 
        strDisplayDepartment=""
        For Each strValue in strDepartment
         strDisplayDepartment = strDisplayDepartment & strValue
        Next
    
        For Each strValue in strDescription
         strDisplayDescription = strDisplayDescription & strValue
        Next
  
    End With
    
End Sub
 
Sub ListGroups( strDomain )
    Set objComputer = GetObject("WinNT://" & strDomain )
    objComputer.Filter = Array( "Group" )
    For Each objGroup In objComputer
    gt = objGroup.groupType
    if (InStr(LCase(objGroup.Name),strSearch) and (gt = &h02)) or (InStr(LCase(objGroup.Name),strSearch) and (gt = &h01)) or (InStr(LCase(objGroup.Name),strSearch) and (gt = &h08))  then
         ReDim Preserve aOpt(intOpt+ 1)
          aOpt(intOpt) = objGroup.Name
          intOpt = intOpt + 1
     end if
    Next
    If intOpt = 0 then
    strMessage ="Uw zoekopdracht heeft geen resultaat opgeleverd."
	Cancelled()
	end if
End Sub
 
Function SelectBox(sTitle, aOptions)
  Dim oIE, s, item
  set oIE = CreateObject("InternetExplorer.Application")
  With oIE
    .FullScreen = True
    .ToolBar   = False : .RegisterAsDropTarget = False
    .StatusBar = False : .Navigate("about:blank")
    Do Until .ReadyState = 4 : WScript.Sleep 100 : Loop
    .width= 400 : .height=200
    With .document
      with .parentWindow.screen
        oIE.left = (.availWidth  - oIE.width ) \ 2
        oIE.top  = (.availheight - oIE.height) \ 2
      End With
      s = "<html><head><title>" & sTitle _
        & "</title></head><script language=vbs>bWait=true<" & "/script>" _
        & "<body bgColor=Silver><center>" _
	& "<b>" & sTitle & "<b><p>" _
        & "<select id=entries size=1 style='width:325px'>" _
        & "  <option selected>" & sTitle & "</option>"
      For each item in aOptions
        s = s & "  <option>" & item & "</option>"
      Next
      s = s & "  </select><p>" _
        & "<button id=but0 onclick='bWait=false'>OK</button>" _
        & "<br><br><span style=" & chr(34)& "font-size: 8pt" & chr(34)& "><A HREF=" & chr(34)& "mailto:scripting@erich.nu" & chr(34)& ">build by Frans Erich</A></span>" _
        & "</center></body></html>"
      .open
      .Write(s)
      .close
      Do until .ReadyState ="complete" : Wscript.Sleep 50 : Loop
      With .body
        .scroll="no"
        .style.borderStyle = "outset"
        .style.borderWidth = "3px"
      End With
      .all.entries.focus
      oIE.Visible = True
      CreateObject("Wscript.Shell").AppActivate sTitle
      On Error Resume Next
      Do While .ParentWindow.bWait
        WScript.Sleep 100
        if oIE.Visible Then SelectBox = "Aborted"
        if Err.Number <> 0 Then Exit Function
      Loop
      On Error Goto 0
      With .ParentWindow.entries
        SelectBox = .options(.selectedIndex).text
      End With
    End With
    .Visible = False
  End With
End Function
 
 
Function KeyExists(sKeyPath)
     keyExists= false: if (sKeyPath="") then exit function
     on error resume next
     createobject("wscript.shell").regRead sKeyPath
     select case err
     case 0: keyExists= true
     case &h80070002: dim sErrMsg
     sErrMsg= replace(err.description, sKeyPath, "")
     err.clear
     createobject("wscript.shell").regRead "HKEY_ERROR\"
     keyExists= not (sErrMsg=replace(err.description, "HKEY_ERROR\", ""))
     case else: keyExists= false
     end select
     on error goto 0
End function
Sub Cancelled()
    strTitle = "Einde script"
    MsgBox strMessage,vbOkOnly,strTitle
    WScript.quit
End Sub 'Cancelled

                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:
221:
222:
223:
224:
225:
226:
227:
228:
229:
230:

Select allOpen in new window

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...