使用审计跟踪在AD中转移用户组

时间:2016-02-05 16:42:17

标签: powershell active-directory active-directory-group

我需要将用户组复制到其他用户并拥有审计跟踪。

这是我的代码:

#This is the user name of the account you want to copy.  
$old = Read-Host

#This is the user account you want to copy to. 
$new = Read-Host

Get-ADPrincipalGroupMembership $old | Set-ADPrincipalGroupMembership $new |
  Export-Csv "pathhere" -NoTypeInformation 

这基本上是我认为可行的代码

#This is the user name of the account you want to copy.  
$old = Read-Host

#This is the user account you want to copy to. 
$new = Read-Host

Get-ADPrincipalGroupMembership $uold | Set-ADPrincipalGroupMembership $new |
  Export-Csv "pathhere" -NoTypeInformation 

我不知道我需要做些什么来完成这个PowerShell中应该是简单的命令。

0 个答案:

没有答案