• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 914
  • Last Modified:

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

0
bsharath
Asked:
bsharath
  • 5
  • 4
1 Solution
 
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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
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
 
bsharathAuthor Commented:
Sent a screenshot
0
 
bsharathAuthor Commented:
Thank you....
0

Featured Post

Will You Be GDPR Compliant by 5/28/2018?

GDPR? That's a regulation for the European Union. But, if you collect data from customers or employees within the EU, then you need to know about GDPR and make sure your organization is compliant by May 2018. Check out our preparation checklist to make sure you're on track today!

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now