创建具有“密码永不过期"的用户在 PowerShell 中 [英] Create user with "password never expires" in PowerShell
本文介绍了创建具有“密码永不过期"的用户在 PowerShell 中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用 CSV 文件和 PowerShell 脚本在我的 AD 中创建很多用户,但我没有找到如何使用参数PasswordNeverExpire"和用户处于活动状态/非活动状态"创建用户.
I want to create a lot of users in my AD with a CSV file and a PowerShell script, but I don't find how to create a user with the argument "PasswordNeverExpire" and "user is active/inactive".
我的 CSV:
推荐答案
您可以创建帐户并使用以下内容
You could create the account and use the following
Set-ADUser -Identity <name> -PasswordNeverExpires $true
这会将帐户的密码设置为永不过期,如果您使用循环创建帐户,则可以将其添加到其中.
this will set the account's password to never expire, if you're using a loop to create the account you can add that into it.
这篇关于创建具有“密码永不过期"的用户在 PowerShell 中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文