Hi All,
I am trying to get users msExchMailboxGUID as a string using the function below, however the msExchMailboxGUID is being returned as System.Byte[]. Any idea how to get this to display as a string?
Function Get-ADProps { $root = [ADSI]"LDAP://*******" $people = Import-Csv .\users.csv $searcher = new-object System.DirectoryServices.DirectorySearcher($root) $ADObjects = @() ForEach($person in $people){ $ADuser = $person.InternetAddress $searcher.filter = "(&(objectClass=user)(mail=$ADUser))" $users = $searcher.FindAll() Foreach($user in $users) { [Array]$propertiesList = $user.Properties.PropertyNames $obj = New-Object PSObject Foreach($property in $propertiesList) { $obj | add-member -membertype noteproperty -name $property -value ([string]$user.Properties.Item($property)) } $ADObjects += $obj } } Return $ADObjects } Get-ADProps | Select msExchMailboxGUID, SAMaccountName
Regards,
Michael.