Skip to content

Instantly share code, notes, and snippets.

@Christwiest
Last active May 25, 2017 09:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Christwiest/c83687fa10ee86a1b522529858bf3434 to your computer and use it in GitHub Desktop.
Save Christwiest/c83687fa10ee86a1b522529858bf3434 to your computer and use it in GitHub Desktop.
Function fill-roid-group
{
Param (
[Parameter(Mandatory)]
$Group
)
Write-Progress -Activity "Loading AD module"
Import-Module ActiveDirectory
Write-Progress -Activity "Getting group members"
$users = get-ADgroupmember -Identity "$group" -Recursive | get-aduser | Where { $_.Enabled -eq $True }
foreach ($user in $users)
{
Write-Progress -Activity "Filling extensionAttribute 10 for $user"
$usersam = $user.samaccountname
Set-ADUser -Identity $usersam -Replace @{ extensionAttribute10 = "IdentityDirector" }
}
}
fill-roid-group -Group "Enter-your-security-group"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment