我需要将用户组复制到其他用户并拥有审计跟踪。
这是我的代码:
#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中应该是简单的命令。