复制用户组

批处理调用PS复制AD里的用户组

@echo off
set u1=
set u2=
set /p u1=from user:
set /p u2=to user:
powershell -command "&{ import-module activedirectory; get-aduser -identity %u1% -prop memberof|select-object -expandproperty memberof|add-adgroupmember -members %u2% }"

标签: batch, powershell

评论已关闭