Get profile paths

What profile paths are your users accessing?  This could be important for troubleshooting

"`nMicrosoft"            
Get-ADUser -LDAPFilter "(&(objectclass=user)(objectcategory=user)(profilepath=*))" -Properties *|            
Format-Table Name, DistinguishedName, ProfilePath -AutoSize            
            
"`nAD provider"            
Get-ChildItem -Filter "(&(objectclass=user)(objectcategory=user)(profilepath=*))" `
 -Path Ad:\"DC=Manticore,DC=org" -Recurse |             
foreach {             
 $user = [adsi]"LDAP://$($_.DistinguishedName)"            
 $user | select @{N="Name"; E={$_.name}},             
 @{N="DistinguishedName"; E={$_.distinguishedname}},            
 @{N="ProfilePath"; E={$_.profilepath}}            
} | Format-Table -AutoSize            
             
"`nQuest"            
Get-QADUser -LDAPFilter "(&(objectclass=user)(objectcategory=user)(profilepath=*))" -IncludeAllProperties |            
Format-Table Name, DN, ProfilePath -AutoSize            
            
"`nScript"            
$root = [ADSI]""            
$search = [adsisearcher]$root            
$search.Filter = "(&(objectclass=user)(objectcategory=user)(profilepath=*))"             
$search.SizeLimit = 3000            
$search.FindAll() | foreach {            
             
$user = $_.GetDirectoryEntry()            
$user | select @{N="Name"; E={$_.name}},             
 @{N="DistinguishedName"; E={$_.distinguishedname}},            
 @{N="ProfilePath"; E={$_.profilepath}}            
} | Format-Table -AutoSize


Similar other searches on the profile tab we look for a profilepath attribute that contains something. It would be possible to put a specific path in here if you wanted to find all users that used a particular path. After the users are found the results are displayed in the usual manner

Leave a Reply