Powershell script that checks if X500 and the user is mail enabled . need a way to check in for contacts.

Hi,

Powershell script that checks if X500 and the user is mail enabled . need a way to check in for contacts.
Can anyone help change theis script to do the same with contacts.

Regards
sharath
Get-QADUser -SearchRoot "OU=offices,DC=ihc,DC=Local" `
    -IncludedProperties msExchMailboxGuid, proxyAddresses | `
  Select-Object Name, Email, `
    @{n='MailEnabled';e={ If ($_.msExchMailboxGuid -ne $Null) { $True } else { $False } }}, `
    @{n='X500';e={ $_.proxyAddresses | ?{ $_ -Match "X500" } }} | `
  Export-CSV "UsersX500.csv"

Open in new window

LVL 11
bsharathAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Chris DentPowerShell DeveloperCommented:
Good morning,

We should be able to do this.

Chris
Get-QADObject -SearchRoot "OU=offices,DC=ihc,DC=Local" -LdapFilter "(objectClass=contact)" `
    -IncludedProperties proxyAddresses | `
  Select-Object Name, mail, `
    @{n='MailEnabled';e={ If ($_.mail -ne $Null) { $True } else { $False } }}, `
    @{n='X500';e={ $_.proxyAddresses | ?{ $_ -Match "X500" } }} | `
  Export-CSV "ContactsX500.csv"

Open in new window

0
bsharathAuthor Commented:
I get this
 "(objectClass=contact)" `
    + CategoryInfo          : NotSpecified: (:) [Get-QADObject], LdapException
    + FullyQualifiedErrorId : System.DirectoryServices.Protocols.LdapException,Quest.ActiveRoles.ArsPowerShellSnapIn.P
   owershell.Cmdlets.GetGenericObjectCmdlet
0
Chris DentPowerShell DeveloperCommented:

Can you try this only please:

Get-QADObject -LdapFilter "(objectClass=contact)"

Chris
0
Introducing the "443 Security Simplified" Podcast

This new podcast puts you inside the minds of leading white-hat hackers and security researchers. Hosts Marc Laliberte and Corey Nachreiner turn complex security concepts into easily understood and actionable insights on the latest cyber security headlines and trends.

bsharathAuthor Commented:
Yes this lists all Contacts
0
Chris DentPowerShell DeveloperCommented:

Add the Search Root back in and see if it still runs:

Get-QADObject -SearchRoot "OU=offices,DC=ihc,DC=Local" -LdapFilter "(objectClass=contact)"

Then if that works, add the IncludedProperties part on and see if that one does.

Chris
0
bsharathAuthor Commented:
Yes Chris it works
Can you tell me the full code please

One Q here
Do you have any idea on how to backup and restore the Communicator Contacts from 2005 to 2007 on the client?
0
Chris DentPowerShell DeveloperCommented:

Extending that back to include the rest:

Get-QADObject -SearchRoot "OU=offices,DC=ihc,DC=Local" -LdapFilter "(objectClass=contact)" `
    -IncludedProperties proxyAddresses | `
  Select-Object Name, mail, `
    @{n='MailEnabled';e={ If ($_.mail -ne $Null) { $True } else { $False } }}, `
    @{n='X500';e={ $_.proxyAddresses | ?{ $_ -Match "X500" } }} | `
  Export-CSV "ContactsX500.csv"

Does that throw the error message again?

> Do you have any idea on how to backup and restore the Communicator Contacts from 2005 to 2007 on the client?

No, sorry. Never had a chance to play with OCS.

Chris
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
bsharathAuthor Commented:
Sent a screenshot
0
bsharathAuthor Commented:
Thank you....
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.