Created
September 21, 2017 11:16
-
-
Save mattwoolnough/08561c11a4f5ff649b5964135be9ada7 to your computer and use it in GitHub Desktop.
Update the EmployeeNumber based on data in the Metaverse
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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