‎10-22-2015 10:24 PM
Solved! Go to Solution.
‎10-26-2015 01:15 PM
‎10-26-2015 01:15 PM
‎10-24-2015 03:41 AM
$aduserinfo = get-aduser -Identity "grant.harrington" -Properties *
$ou = $aduserinfo.distinguishedname.split(",")[1]
$ou = $ou.substring(3)
$ADUserProps = [ordered]@{
'OU' = $ou
'Country' = $aduserinfo.Country
'UserName' = $aduserinfo.Name
'EmailAddress' = $aduserinfo.EmailAddress
'Surname' = $aduserinfo.Surname
'GivenName' = $aduserinfo.GivenName
'Employee ID' = $aduserinfo.extensionAttribute1
'TelephoneNumber' = $aduserinfo.telephoneNumber
'Title' = $aduserinfo.Title
'sAMAccountName' = $aduserinfo.SamAccountName
}
$ADUserObj = New-Object -TypeName PSObject -Property $ADUserProps
Write-output $ADUserObj
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now