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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
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.

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
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
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

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
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

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
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
Chat / IM

From novice to tech pro — start learning today.