< Back

Get-ADObjectAttribute

Mon Jan 13, 2020 8:09 pm

NAME Get-ADObjectAttribute



SYNOPSIS

The cmdlet enables you to fetch AD attributes from ADSIEDIT of the given object





SYNTAX

Get-ADObjectAttribute [-ObjectClass] <String> [-Property] <String> [-Value] <String> [<CommonParameters>]





DESCRIPTION

Usually inorder to search/ fetch AD attributes one need to have AD modules installed. This cmdlet allows you to

fetch without any modules. What all you need is PowerShell





PARAMETERS

-ObjectClass <String>

Specifies the object class type. For example if you wish to search an user then the ObjectClass should be user

and for a group then its Group, OU and so on. When you are not sure then you can give '*'



Required? true

Position? 1

Default value

Accept pipeline input? true (ByValue, ByPropertyName)

Accept wildcard characters? false



-Property <String>

Specifies the property name using which you wish to search. Let say mail, userprincipalname,

distinguishedname..etc



Required? true

Position? 1

Default value

Accept pipeline input? true (ByValue, ByPropertyName)

Accept wildcard characters? false



-Value <String>

Specifies the Value of the 'Property' that you inputted



Required? true

Position? 1

Default value

Accept pipeline input? true (ByValue, ByPropertyName)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

ObjectClass,Property using which you want to search and it's value





OUTPUTS

System.DirectoryServices.SearchResult





-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Get-ADObjectAttribute -ObjectClass * -Property mail -Value User@CloudComputee.com



Path Properties

---- ----------

GC://CN=User\\, K,OU=Employees,OU=Users,OU=Small Locations,OU=Other CountriesDC=CloudComputee,DC=com {c,

department, msexchrecipienttypedetails, prim...



When you don't know the type of the object class then you can give '*'









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Get-ADObjectAttribute -ObjectClass user -Property mail -Value User@CloudComputee.com



Path Properties

---- ----------

GC://CN=User\\, K,OU=Employees,OU=Users,OU=Small Locations,OU=Other CountriesDC=CloudComputee,DC=com {c,

department, msexchrecipienttypedetails, prim...



When you are certain about the object class type then you can specify











RELATED LINKS