H
H
Human2016-04-11 11:35:37
PowerShell
Human, 2016-04-11 11:35:37

How to create exchange users through excel?

You need to create users from excel
An excel is created with columns fullname OU SAM name lastname password UPN, then exported to csv (MSDOS)
there are Russian names with Cyrillic, then opened with notepad and saved in UTF-8
, then the script
Import-CSV c:\users is done. csv | ForEach-Object {New-Mailbox -Name $_.”fullname” -Alias ​​$_.”alias” -OrganizationalUnit $_.”OU” -SamAccountName $_.”SAM” -FirstName $_.”name” -LastName $ _.”lastname” -Password (ConvertTo-SecureString _.password -AsPlainText -Force) -UserPrincipalName $_.”UPN” -ResetPasswordOnNextLogon $false }
and nothing happens, what could be the catch?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
E
Ethril, 2016-04-11
@Ethril

A snag in some problems.

E
Eugene, 2016-04-11
@yellowmew

first, learn the -Encoding switch and in the import-csv cmdlet,
in particular, in the format you save, you can use -Encoding OEM
AND, just in case, -Delimiter to specify the specific list separator to use.
Secondly, as you have already been told, the problem can be literally in every step that you perform with the cmdlets for creating a new mailbox: from the inability to connect to exchange services or the lack of access to create users in the corresponding OU AD, to banal typos in the cmdlet text.
Give the text of errors for analysis and help. The content of psychics in the state translates into a pretty penny.
$_.”fullname” why are there quotes here?

H
Human, 2016-04-11
of Humans @tenhi_shadow

thanks, Cap!

A
Anatoly, 2016-07-05
Ivashina @tiv

I advise you to read "How to ask questions correctly": segfault.kiev.ua/smart-questions-ru.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question