Lync Enabled List with AD properties

I want to export list of lync enabled users with all details as below.

name, mail address, sipaddress, OU, Department, Country, Street, OfficeAddress, telephone, manager
ramiz, ramiz@test.net, ramiz@test.net, "OU=Employee,OU=Users,DC=domain,DC=local", Tanzania, Brooklyn Street, 2-48/A Express Avenue, 1848-885-8585, Robert


Any help is appreciated.
LVL 12
Ganesh Kumar ASr Infrastructure SpecialistAsked:
Who is Participating?
 
Will SzymkowskiSenior Solution ArchitectCommented:
When you have a Lync enabled user it will have this attribute assigned to the users AD attributes. When the user has this attribute associated with there AD account it means that the account is Lync Enabled.

I have tested this once again in my lab and it works with no issues. Something must be setup differently in your environment. However you can close this question as I have exhausted all of what I can recommend. It works and that's a fact. I cannot see in to your network so I do not know what may be different.

Will.
0
 
Marwan OsmanCommented:
get-csuser | Select-Object DisplayName, mail, SIPAddress, canonicalName, department, countryCode, streetAddress, physicalDeliveryOfficeName, telephoneNumber, manager >e:\user.csv
0
 
Will SzymkowskiSenior Solution ArchitectCommented:
All of the attributes you are asking for are not avialable from the Get-CSUser cmdlet. You can use Get-ADuser to get all of the attributes that you require.
Import-Module activedirectory
Get-Aduser -Filter * -Properties * | 
? { $_.msRTCSIP-UserEnabled -eq $true } | 
select Name, EmailAddress, msRTCSIP-PrimaryUserAddress, CanonicalName, Country, StreetAddress, Office, TelephoneNumber, Manager | 
Export-Csv "c:\userexport.csv" -nti

Open in new window


Will.
0
Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

 
Ganesh Kumar ASr Infrastructure SpecialistAuthor Commented:
Somehow i managed by using csvde -f filename.csv which brought me all details and chose the relevant using filters in excel and made up my report. I want based on OU and none of the above solution provided didn't help. Hence i found the answer myself and i want to delete this question or leave the question closed.
0
 
Ganesh Kumar ASr Infrastructure SpecialistAuthor Commented:
I've requested that this question be closed as follows:

Accepted answer: 0 points for Ganesh Kumar A's comment #a40779727

for the following reason:

The solution provided is not having OU information which i want to generate in report and that is the most important requirement. But the script provided didn't help so i used csvde -f filename and exported and used the relevant attributes with some formatting and the report is good for me.
0
 
Will SzymkowskiSenior Solution ArchitectCommented:
The CanonicalName illustrates exactly where the account is located providing the OU path. Answer ID: 40772605 should be accepted as the solution. As i have tested this any it shows exactly what you have requested.

Will.
0
 
Ganesh Kumar ASr Infrastructure SpecialistAuthor Commented:
Hi Will i get the following error while running this command in Lync powershell.

At line:1 char:53
+ Get-Aduser -Filter * -Properties * | ? { $_.msRTCSIP-UserEnabled -eq $true }
| s ...
+                                                     ~~~~~~~~~~~~
Unexpected token '-UserEnabled' in expression or statement.
At line:1 char:66
+ Get-Aduser -Filter * -Properties * | ? { $_.msRTCSIP-UserEnabled -eq $true }
| s ...
+                                                                  ~~~
Unexpected token '-eq' in expression or statement.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordEx
   ception
    + FullyQualifiedErrorId : UnexpectedToken
0
 
Will SzymkowskiSenior Solution ArchitectCommented:
You do not run this command in the Lync Powershell window. As i stated in my first post, all of the attributes that you are asking for are not present using Get-CSUser. You need to run this in a regular powershell session and make sure that import-module activedirectory is also loaded into the session.

All of the required fields you have requested have been provided. In Active Directory when you use Get-ADUser msRTCSIP-PrimaryUserAddress is the users Lync Sip Address. It is just presented this way using Get-ADUser. a side from that everything works fine. I have tested this in my lab.

Will.
0
 
Ganesh Kumar ASr Infrastructure SpecialistAuthor Commented:
I tried running powershell. I first ran import-module activedirectory and then executed the command.
0
 
Will SzymkowskiSenior Solution ArchitectCommented:
Then it should work. It works in my lab. What is the error message you are receiving?

Will.
0
 
Ganesh Kumar ASr Infrastructure SpecialistAuthor Commented:
Will,

I posted the error message already
0
 
Will SzymkowskiSenior Solution ArchitectCommented:
You said that you ran this script from Lync powershell. When you run it from a regular powershell session make sure that the active directory module is imported into the session and run the script and your done.

Will.
0
 
Ganesh Kumar ASr Infrastructure SpecialistAuthor Commented:
I tried with windows powershell i get the same message :

rt.csv" -nti
At line:1 char:53
+ Get-Aduser -Filter * -Properties * | ? { $_.msRTCSIP-UserEnabled -eq $true } | s ...
+                                                     ~~~~~~~~~~~~
Unexpected token '-UserEnabled' in expression or statement.
At line:1 char:66
+ Get-Aduser -Filter * -Properties * | ? { $_.msRTCSIP-UserEnabled -eq $true } | s ...
+                                                                  ~~~
Unexpected token '-eq' in expression or statement.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : UnexpectedToken
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.