RSS
 

Archive for the ‘Geek Zone’ Category

Bulk import Active Directory Users and Create Email address

01 Jul

I was tasked at work to come up with a way to import new Active Directory accounts and Exchange 2007 email boxes.  I decided to use the Exchange 2007 Management Console which uses lots of powershell.

Here is what I came up with:

This command is used to import users from a CSV file into Exchange 2007 creating email boxes and user accounts.  User accounts are set to change password upon first log in.

Created 20090630, By Mario Leal

NOTES:

  • Command must be copied and pasted into the Exchange Management Console.
  • You must edit “C:\CSV\users.csv” to be the the location of your CSV file.
  • The CSV file must not have an empty line at the end of the file.
  • Duplicates will error, you must watch screen to catch them.
  • Empty middle initial in CSV needs one ” to represent blank.
  • Output file (output.txt) will give a list of successful imports.

Schema (first Line) used for CSV file with an example (second line):
alias,Name,UPN,password,givenName,surname,middleI
maleal,”Mario Leal”,email@address.whatever,somepassword,Mario,Leal,A

Reference URLs:

http://social.technet.microsoft.com/Forums/en-US/exchangesvradmin/thread/2582c672-cddb-4446-9329-889139ebb346
http://www.exchangepedia.com/blog/2006/11/exchange-server-2007-bulk-creation-of.html
http://exchangepedia.com/blog/2006/12/bulk-mailbox-enabling-users-exchange-shell.html

—commandstart—
Import-CSV c:\CSV\users.csv | foreach {

$secureString = ConvertTo-SecureString -string $_.password -AsPlainText –Force

new-mailbox -alias $_.alias -name $_.name -userPrincipalName $_.UPN -FirstName $_.givenName -LastName $_.surname -Initials $_.middleI -database “Students” -org TEST -Password $securestring -ResetPasswordOnNextLogon $true

} | out-file -filepath “c:\CSV\Output.txt”
—commandend—

Related Links:

 
 

Internet Explorer 7 Crashes When Sending Messages Through OWA 2003

23 Apr

Because we decided to wait to move everyone to the new exchange server after this semester, I found and fixed the issue regarding IE7 crashing when sending messages through webmail.

The problem stemmed from the S/MIME installation file.  That installation file fixes the red “X,” but can cause the next problem.  That problem is that IE7 will crash when users click the send button on messages.  This involved the installation of a hotfix on Exchange (Then, a reboot) and requires users to uninstall the old S/MIME file on their computer.  Then, they have to go back to the OWA options page and install the S/MIME file again.  When finished, the S/MIME version should be: 6.5.7651.60.

Here are the links that describe this:

The Problem:
http://www.petri.co.il/ie7_crashes_when_posting_messages_in_owa_2003.htm

If users have trouble removing the S/MIME file:
http://www.petri.co.il/removing_smime_control_in_owa_2003.htm

Microsoft Fix:
http://www.microsoft.com/downloads/details.aspx?amp;displaylang=en&familyid=41275DEC-4C01-4C41-AA64-C9DBE5EA3F7E&displaylang=en

Related Links:

 
 

VBS Scripts

30 Mar

At my job, we are moving to all vbs scripts for our login scripts.

Here are some that map network drives:

—-begin script—-
dim wshnetwork
set wshnetwork = wscript.createobject(“wscript.network”)
ON ERROR RESUME NEXT
wshnetwork.removenetworkdrive “Z:”
netshare = “\\servername\sharename”
wshnetwork.mapnetworkdrive “Z:”,netshare
—-end script—-

Don’t forget “ON ERROR RESUME NEXT” because the script will die on any errors…like if the user doesn’t have a drive mapped called “z.”  This would prevent it actually being mapped.

Here’s another script that connects a printer and sets that printer to default.

—-begin script—-
Set objNetwork = CreateObject(“WScript.Network”)
objNetwork.AddWindowsPrinterConnection “\\printerservername\printername”
objNetwork.SetDefaultPrinter “\\printerservername\printername”
—-end script—-

Enjoy!

Mario

Related links: