infamousjoeg
5/3/2017 - 12:57 AM

From Ben Floyd, National Customer Success: get the largest field from the current AD schema given that your current user can see all attribu

From Ben Floyd, National Customer Success: get the largest field from the current AD schema given that your current user can see all attributes of course

[DirectoryServices.ActiveDirectory.ActiveDirectorySchema]::GetCurrentSchema().FindClass('user').optionalproperties `
| select name,rangeupper | where Name -eq 'sn'

[DirectoryServices.ActiveDirectory.ActiveDirectorySchema]::GetCurrentSchema().FindClass('user').optionalproperties `
| select name,rangeupper | Sort-Object -Property rangeupper | select-object -last 1