Group Management
Add user to Group.
· Add-QADgroupmember -identity $groupName -member $usern
· get member count from group
o (get-qadgroup "srv0_app_websense_marketing").members.count
List account Group Membership
· get-qadmemberof twalters |select name, description | sort-object name | out-gridview
Add user's of one group to another group
· get-qadgroupmember "srv0testg1" | select name > testg.txt ; get-content .\testg.txt | foreach-object { add-qadgroupmember -identity srv0testg2 -member $_}
Add One Users Groups to Another User
· get-qadmemberof wsweatt | select name > c:\temp\wsweattgroups.txt; get-content c:\temp\wsweattgroups.txt | foreach-object { add-qadgroupmember $_ -member twalters}
· get-qadmemberof wsweatt | foreach-object { add-qadgroupmember $_ -member twalters}
List members of a group
· get-qadgroupmember "Some Group Name" | select name
· get-qadgroupmember "Some Group Name" | where { $_ -match "TheirLastName" }
Distribution Groups
· List Distribution Group information:
· PS C:\Windows> get-qadgroup "DL – DLNAME" | format-list name, Alias, Mail, Managedby
· One liner to list group membership:
· get-qadgroupmember "DG - Name" |select Name
Script one-liner I ran to add users to group, after creating user list file called dglist:
· get-content dglist | foreach-object { add-qadgroupmember -identity "DG Name" -member $_ }
No comments:
Post a Comment