ACTIVE DIRECTORY

I need to get employee list for everyone that is in the AD Group: LANMailAll

how to get  employee ID, SAMAccount, Name and Email where available AND EXPORT IT?
pramod1Asked:
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.

FOXActive Directory/Exchange EngineerCommented:
get-adgroup lanmailAll | get-adgroupmember | select samaccountname, employeeid, email | sort-object samaccountname | out-file c:\temp\lanmailall.txt

**for out-file give it the path of your choice wherever you want to drop the file
0
pramod1Author Commented:
The term 'get-adgroup' is not recognized as the name of a cmdlet, function, script file, or operable program. Check t
 spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:12
+ get-adgroup <<<<  lanmailAll | get-adgroupmember | select samaccountname, employeeid, email | sort-object samaccoun
ame | out-file c:\temp\lanmailall.txt
    + CategoryInfo          : ObjectNotFound: (get-adgroup:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

I am getting above error in EMS
0
FOXActive Directory/Exchange EngineerCommented:
run the command import-module activedirectory  then try again
0
Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

pramod1Author Commented:
[PS] C:\Windows\system32>import-module activedirectory
Import-Module : The specified module 'activedirectory' was not loaded because no valid module file was found in any mod

I am running IN EMS
0
FOXActive Directory/Exchange EngineerCommented:
you are in Exchange management console?  Is this a distributiongroup or an activedirectory group?
0
pramod1Author Commented:
it is mail universal security group, checked in exchange console
0
Thomas GrassiSystems AdministratorCommented:
Look at Get-ADuser -identity username | export-csv c:\xyz.csv
0
FOXActive Directory/Exchange EngineerCommented:
get-distributiongroup lanmailAll | get-distributiongroupmember | select samaccountname, employeeid, email | sort-object samaccountname | out-file c:\temp\lanmailall.txt
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
pramod1Author Commented:
it is mail universal security group  group
0
FOXActive Directory/Exchange EngineerCommented:
Pramod,
right-click powershell and run as administrator.  
then type in import-module activedirectory
then run this command  
get-adgroup lanmailAll | get-adgroupmember | select samaccountname, employeeid, email | sort-object samaccountname | out-file c:\temp\lanmailall.txt

I just ran it on a universal security group and I received the proper output.  For your out-file set a path of your desire or create a temp folder in your c: drive and use the same exact command I have
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
Active Directory

From novice to tech pro — start learning today.

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.