GJohn32
asked on
DIRECTORY SERVICES -Filter an ADSI Attribute
(Exchange 2010)
Hello all,
My goal is to locate all the employees in the company and add an Exchange Custom Attribute. Now the only field that identifies the user as an employee is in ADSI Edit, which was updated thru a Schema change.
When I run the following cmd below in EMS, it appears to complete but does not not add 'Employee' to EMC Custom Attribute4
Hello all,
My goal is to locate all the employees in the company and add an Exchange Custom Attribute. Now the only field that identifies the user as an employee is in ADSI Edit, which was updated thru a Schema change.
When I run the following cmd below in EMS, it appears to complete but does not not add 'Employee' to EMC Custom Attribute4
$Searcher = New-Object -Typename DirectoryServices.Director ySearcher ($domain = [ADSI]"")
$Searcher.filter = "(&(objectClass=user)(HRPr o=TRUE))"
$userResult = $Searcher.findall()
$Empl = $userResult
<#
########################## ########## ##
$Empl | Foreach{
$Entry = $_.GetDirectoryEntry()
$DN = ($Entry.DistinguishedName) .ToString( )
$scriptpath = ($Entry.scriptpath).ToStri ng()
Set-Mailbox $DN -CustomAttribute4 “Employee”}
#>
$Searcher.filter = "(&(objectClass=user)(HRPr
$userResult = $Searcher.findall()
$Empl = $userResult
<#
##########################
$Empl | Foreach{
$Entry = $_.GetDirectoryEntry()
$DN = ($Entry.DistinguishedName)
$scriptpath = ($Entry.scriptpath).ToStri
Set-Mailbox $DN -CustomAttribute4 “Employee”}
#>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
$Searcher.filter = "(&(objectClass=user)(HRPr
$userResult = $Searcher.findall()
$userResult.count