无法通过Powershell将用户导入Ad [英] Trouble importing users into Ad through Powershell

查看:85
本文介绍了无法通过Powershell将用户导入Ad的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下午女士们,先生们,


我在这里就我的剧本征求意见,我的目标是通过powershell将多个用户输入csv文件到广告中。然后在exchange powershell控制台上使用enable mailbox命令。我有SurName,Given Name,DisplayName,Name和SamAccountName。
我将它保存为csv文件。我运行powershell和管理员,我也使用import-module activedirectory。当我执行以下操作时:


" Import-Csv。\users\david\desktop\test users.csv"


我完全看到用户及其信息,但是当我这样做时;


New-ADUser -enabled $ true并使用安全字符串设置密码。


用户被输入,但是我收到一个错误,上面写着"名称"这个词。空白。用户在"用户"中。文件夹,但未创建登录名,用户必须更改密码未检查,并且@ test.local.net未在帐户选项卡上的域框中输入
。任何建议都会很棒,如果您需要查看完整的脚本或有更好的方法来执行此操作,请告诉我,因为我不熟悉脚本。这与工作没有关系,我只是想在我的实验室练习脚本
我有。

解决方案

你需要首先学习hw使用PowerShell然后学习AD。 之后,您将能够使用帮助来查看如何使用AD CmdLets。


我们无法教你PS。


请阅读以下内容非常仔细地获取有关如何获得帮助的说明:

https://social.technet.microsoft.com/Forums/en-US/c47b1bc2-f7fd-4d2e -8ff2-e8a81ce090d4 / this-forum-is-for-scripting-questions-than-than-script-requests?forum = ITCG


您还可以在这里找到更多帮助: 
https://technet.microsoft.com/en-us /scriptcenter/dd793612.aspx?f=255&MSPPError=-2147217396





Good Afternoon Ladies and Gentlemen,

I am here to ask for advice on my script, my goal is to input multiple users with a csv file into ad via powershell. Then use the enable mailbox command on the exchange powershell console. I have the SurName, Given Name, DisplayName, Name and SamAccountName. I Save it as a csv file as such. I run powershell and administrator and I use the import-module activedirectory as well. When I do the following:

"Import-Csv .\users\david\desktop\test users.csv"

I see the users and their information perfectly, but when I do the;

New-ADUser -enabled $true and set the password with a secure string.

The users get inputed, but I get an error saying that the term "name" was blank. The users are in the "users" folder, but the logon name was not created, user must change password was not checked and the @test.local.net was not inputted in the domain box on the account tab. Any advice would be great, if you need to see the full script or have a better way to do this, please let me know as I am new to scripting. This is not work related, I just want to practice scripts on my lab that I have.

解决方案

You need to start by learning hw to use PowerShell then learn AD.  After that you will be able to use help to see how to use the AD CmdLets.

We cannot teach you PS.

Please read the following very carefully for instructions on how to get help.: https://social.technet.microsoft.com/Forums/en-US/c47b1bc2-f7fd-4d2e-8ff2-e8a81ce090d4/this-forum-is-for-scripting-questions-rather-than-script-requests?forum=ITCG

You can also find more assistance here:  https://technet.microsoft.com/en-us/scriptcenter/dd793612.aspx?f=255&MSPPError=-2147217396


这篇关于无法通过Powershell将用户导入Ad的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆