No - I meant the $aRecord var, which I didn't Dim in the core script. I had not had any coffee when I wrote this, so didn't (ok - couldn't) think about dimming vars or writing REALLY good code. It was just a heads-up to you that, depending on your coding style, should give it a closer inspection once you got the basic code working.

I'm a bit torn about the way the $aUserData array is used. The way it's presented makes it very clear what you are doing inside the code, but it isn't very efficient. I'd probably use the $aUserData[] variable directly and eliminate the "$DirectName = $aUserData[]" assignments and Dims, but add clear comments to each line so there's no guessing as to what's going on. For example:
 Code:
; get rid of this
Dim $Domain, $ContainerDN, $Account, $FirstName, $MiddleInitial, $LastName, $Description, $Office, $Telephone, $Email, $WebPage, $userPrincipalName
; and all of these
$Domain 	  = $aUserData[0]

; and change all of these:
$oUser.Put("givenName", $FirstName)     ;First Name

; to this format:
$oUser.Put("givenName", $aUserData[3])     ;First Name


Glenn
_________________________
Actually I am a Rocket Scientist! \:D