2017/10/18

Copy Group Membership to another user


From:
http://www.sysadmins.eu/2015/02/copy-group-membership-to-another-user.html

因為memberof是object array,所以要select之後 轉給Add-AdroupMember

To get actual group membership for user John.Doe you can use:
get-aduser -identity John.Doe -properties memberof | select-object memberof -expandproperty memberof
To copy groups to another existing user use:

get-aduser -identity John.Doe -properties memberof | select-object memberof -expandproperty memberof | Add-AdGroupMember -Members Jane.Doe

If you wanna know what groups were copied:
get-aduser -identity Jane.Doe -properties memberof | select memberof -expandproperty memberof | Add-ADGroupMember -members John.Doe -PassThru

You can also copy groupmembership to multiple users:
get-aduser -identity Jane.Doe -properties memberof | select memberof -expandproperty memberof | Add-ADGroupMember -members John.Doe,Jack.Doe -PassThru

沒有留言:

windows 無法拖動文件

原因:未知 症狀:windows點任何文件,都無法拖動到其他地方  解決方式: 來源: https://answers.microsoft.com/en-us/windows/forum/all/drag-and-drop-stopped-working/b73e4938-ca2...