So... now that you mention it. ;)
I'm knee deep in the first real-world task of creating a powershell script.
I will be happy to accept a nudge in the right direction (or a cluex4, if
I'm missing the obvious)

The script imports user data from a csv; and uses that data to create their
username and email address. Then it checks if the username / email is in
use; gives an error if it does, creates the user or mailbox if it doesn't.
It also updates attributes, one being the employee number.
I need to export the newly created usernames, emails, and the employee
number.
I've created an array that adds each new user, and then is exported to a
csv.
Everything works, except the "employeenumber", which is what HR is using as
the primary key.

 The array is
$createdusers +@()
and then:
              $createdusers += $Newuser
              $createdusers|select displayname,name,email,employeenumber
|export-csv "C:\temp\scripts\tryagain.csv"

Any ideas to get the employeenumber to export?
The other thing is this pulls the email, even if the user doesn't get a
mailbox.
Thanks all.
Candee


On Tue, Apr 16, 2013 at 2:11 PM, Ben Scott <mailvor...@gmail.com> wrote:

> On Tue, Apr 16, 2013 at 12:57 PM, James Rankin <kz2...@googlemail.com>
> wrote:
> > Ben, you're a wizard, that worked first time out :-)
>
>   I am but a humble student.  Indeed, I'm getting my feet wet with
> PoSh for "real use" for the first time these past few weeks.  Part of
> the reason I did this was to learn how to do it.  I had to learn
> Select-String last week, but didn't know how to retrieve captured
> groups yet, nor how to write to the registry.  So we both learned some
> things!
>
>   It helps that I had the web at my end of the thread.  :-)
>
> -- Ben
>
> ~ Finally, powerful endpoint security that ISN'T a resource hog! ~
> ~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~
>
> ---
> To manage subscriptions click here:
> http://lyris.sunbelt-software.com/read/my_forums/
> or send an email to listmana...@lyris.sunbeltsoftware.com
> with the body: unsubscribe ntsysadmin
>

~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~

---
To manage subscriptions click here: 
http://lyris.sunbelt-software.com/read/my_forums/
or send an email to listmana...@lyris.sunbeltsoftware.com
with the body: unsubscribe ntsysadmin

Reply via email to