Skip to content

Instantly share code, notes, and snippets.

@mattwoolnough
Created September 21, 2017 11:16
Show Gist options
  • Save mattwoolnough/08561c11a4f5ff649b5964135be9ada7 to your computer and use it in GitHub Desktop.
Save mattwoolnough/08561c11a4f5ff649b5964135be9ada7 to your computer and use it in GitHub Desktop.
Update the EmployeeNumber based on data in the Metaverse
Import-Module LithnetMIISAutomation
Get-CSObject -MA "Aurion Schedules MA" -DN "OU=ScheduleUsers,DC=IdentityBroker" -IncludeSubTree |
ForEach-Object {
$user = Get-MVObject $_.MvGuid
$givenName = $user.attributes.givenName.Values.ValueString
$sn = $user.attributes.sn.Values.ValueString
$pn = $user.attributes.'unify_Aurion-WamiKey'.Values.ValueString
Get-ADUser -Filter 'givenName -eq $givenName -and sn -eq $sn' -Property EmployeeID, EmployeeNumber | Set-ADUser -EmployeeNumber $pn
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment