Share via

power shell pop up window

Ilya Bokov 165 Reputation points
2024-08-22T10:38:40.35+00:00

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

Exchange Online
Exchange Online

A cloud-based service included in Microsoft 365, delivering scalable messaging and collaboration features with simplified management and automatic updates.

Exchange | Exchange Server | Other
Exchange | Exchange Server | Other

A robust email, calendaring, and collaboration platform developed by Microsoft, designed for enterprise-level communication and data management.Miscellaneous topics that do not fit into specific categories.

Windows for business | Windows Client for IT Pros | Directory services | Active Directory
Windows for business | Windows Server | User experience | PowerShell
Windows for business | Windows Server | User experience | Other
0 comments No comments

Answer accepted by question author

Rich Matheisen 48,116 Reputation points
2024-08-22T14:53:51.4866667+00:00

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
}

Was this answer helpful?

1 person found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. Ilya Bokov 165 Reputation points
    2024-08-27T05:58:34.39+00:00

    @Rich Matheisen can you help?

    Was this answer helpful?

    0 comments No comments

  2. Ilya Bokov 165 Reputation points
    2024-08-23T06:08:06.18+00:00

    may be you can help, to make drop down menu from OU before $msg

    User's image

    SQLCopy

    Add-ADGroupMember -Identity $dropdownmenu_groups_from_OU_list -Members $msg
    

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.