Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/silverlight/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/elixir/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Powershell脚本Active Directory_Powershell - Fatal编程技术网

Powershell脚本Active Directory

Powershell脚本Active Directory,powershell,Powershell,需要一些关于如何构造Powershell脚本的指针,该脚本可执行以下操作:请求active directory用户名,提供一个菜单以启用这些active directory操作为用户名提供:重置密码、禁用用户帐户、启用用户帐户、解锁用户帐户、删除用户帐户?要请求用户输入,尝试读取主机。例: $username = Read-Host "Type in username" 创建菜单的方法有很多种。您可以使用Write Host显示信息和Read Host+aswitch-语句手动执行选择的答案。

需要一些关于如何构造Powershell脚本的指针,该脚本可执行以下操作:请求active directory用户名,提供一个菜单以启用这些active directory操作为用户名提供:重置密码、禁用用户帐户、启用用户帐户、解锁用户帐户、删除用户帐户?

要请求用户输入,尝试读取主机。例:

$username = Read-Host "Type in username"
创建菜单的方法有很多种。您可以使用
Write Host
显示信息和
Read Host
+a
switch
-语句手动执行选择的答案。或者,您可以将内置解决方案与and-对象一起使用(每个菜单项一个)

菜单示例:

  • 使用内置菜单类/-解决方案:
  • 简单手动创建的菜单: