Greeting from the northeast snow, I thought I had everything working and done. Testing was completed multiple times with the right results.
Then I was asked, can you make a change for us? Instead of show what the actual group names in AD are, we want you to rename them to something we want.
So here is the line that strips the group information down to just the CN name.
Powershell
$gmemeber=$user.memberof-replace"CN=|,.*"-join","
From this point, everything was working great.
Now they want me to rename the groups to what they want. So if John is in a group called Group 1, then they want me to rename it to newgroup1.So I tried to do the following with if statements but nothing is showing up.
Powershell
If($gmemeber-eq"Group1"){$rename1=Rename-Item-NewName"newnamegroup1"}If($gmemeber-eq"Group2"){$rename2=...