Hello I am a powershell beginner and need some help with a script. Below is what i have so far<\/p>\n
I am trying to have it so that it used the credentials of the IT admins, takes all the groups and adds the user of our choice to them and then reads out the list it just added to,<\/p>\n
I may be missing Select-Object -Property samaccountname at the end im not sure<\/p>\n
##Import<\/span> Active directory module so you can use the tools<\/p>\n Import-Module ActiveDirectory<\/p>\n $cred=Get-Credential<\/p>\n ($userbeingadded =Read-Host -Prompt “Enter User Name to add to groups”)<\/p>\n $basicgroupslist = “SG_group”,“group List”,“group Protected”,“group Users”,“groupProduction”,“group_Production”, {Add-ADGroupMember -Identity $basicgroupslist -Members $userbeingadded } | -Credential $cred<\/p>","upvoteCount":8,"answerCount":4,"datePublished":"2020-02-26T23:55:21.000Z","author":{"@type":"Person","name":"carlolslinares","url":"https://community.spiceworks.com/u/carlolslinares"},"acceptedAnswer":{"@type":"Answer","text":"<\/a>Ask for credentials, please use your SU credentials<\/h2>\n
<\/a>Prompt for user being added to the basic groups<\/h2>\n
<\/a>List of basic groups for a regular user at Alteryx<\/h2>\n
\n“groupAccess”,“SG_1_Production”,“SG_2t_Production”,“SG_3_Production”,“SG_4_Production”,
\n“SG_5_Production”,“SG_6_Production”,“SG_7_Production”,“SG_8_Production”,
\n“SG_9_Production”,“SG_10_Production”,“SG_11_Production” | ForEach-Object<\/p>\n