PS script to create a new ADSG from existing SG / OU

hi , i am rather new to a PS scripting
I need a PowerShell script that will:
. Look into a AD OU / SG group members.
. Will create an additional user for each user in the group in a dedicated different OU with minor changes:
. Modifying the username as a prod-admin user. For example: original user John Smith ; new user JohnS-prod-admin.
. (Add “Prod Admin” to the user’s last name.)

thanks in advacne for helping

A.shin,
welcome to the forums.

What kind of help do you need? We do not write ready to use code on request. You will have to do it by yourself. But we will be happy to help you further if you get stuck with code you wrote. So you may share this code here and the errors if there are some and we will try our best. :wink:

. Look into a AD OU / SG group members.

Get-ADUser (by OU)
Get-ADGroupMember + Get-ADUser (by SG)

. Will create an additional user for each user in the group in a dedicated different OU with minor changes:
. Modifying the username as a prod-admin user. For example: original user John Smith ; new user JohnS-prod-admin.
. (Add “Prod Admin” to the user’s last name.)

New-ADUser

1 Like