Exchange Server
A family of Microsoft client/server messaging and collaboration software.
1,285 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
hi everyone!
can somebody help me, to make ps1 script when it starts -
1 command:
$getusergroups = Get-ADUser -Identity (open popup window to put sAMAccountname) -Properties memberof | Select-Object -ExpandProperty memberof
where popupwindow - it need to put source sAMAccountname from active directory
and then $getusergroups | Add-ADGroupMember -Members targetsAMAccountname -verbose
thanks a lot
Here's a brief example of doing that:
Add-Type -AssemblyName Microsoft.VisualBasic
$title = 'Account'
$msg = 'Enter the user account name:'
$text = [Microsoft.VisualBasic.Interaction]::InputBox($msg, $title)
If ($text){
Get-LocalUser $text
}
Else {
"Sorry" # either no input from user or the "Cancel" button was used
}
may be you can help, to make drop down menu from OU before $msg
SQLCopy
Add-ADGroupMember -Identity $dropdownmenu_groups_from_OU_list -Members $msg
@Rich Matheisen can you help?