-2

I want to get data of Active Directory located on another server. I have server details but I don't know how to get use it. However, I know how to get data if I run PowerShell Script from same server.

Here is links from there I got code to get data which works fine if I get data by PowerShell Script located from same server. Can anybody please suggest me how can I get data from Active Directory located on another server?

https://gallery.technet.microsoft.com/scriptcenter/Powershell-script-to-5edcdaea

http://woshub.com/get-aduser-getting-active-directory-users-data-via-powershell/

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Nanji Mange
  • 2,155
  • 4
  • 29
  • 63
  • You've **just asked** this same question only 2 hours ago - please **DO NOT** post the same question over and over and over again! – marc_s Aug 09 '18 at 07:13
  • @Am_I_Helpful I will apply your answer today. I will surely react on result. Thank you for your time. – Nanji Mange Aug 10 '18 at 08:03
  • @Am_I_Helpful, As there is some server issue from my side, I am not able to connect. I am resolving that first. Your reference looks fine. However, I will check again once all the issues done from server side. Thanks – Nanji Mange Aug 14 '18 at 06:30
  • @NanjiMange - You may like to upvote the answer as well, if it helped you. See how to upvote an answer -> https://meta.stackexchange.com/questions/173399/how-to-upvote-on-stack-overflow – Am_I_Helpful Aug 14 '18 at 07:15

1 Answers1

0

This question is almost a duplicate of your previous question about "How to add/update user data to LDAP Active Directory located on another server using PowerShell script".

You need to additionally use the -Server <string> parameter to connect to other server with your Get-ADUser cmdlets.

How to get user Data from LDAP Active located on another server directory using PowerShell Script?

You've already used the cmdlet Get-ADUser in the flagged duplicate. I'm showing a sample example below on finding all active user-objects and their properties:

Get-ADUser -Filter {(SamAccountName -eq $Username) -And (Enabled -eq 'True')} -Server a.b.c.d | Select-Object *
Am_I_Helpful
  • 18,735
  • 7
  • 49
  • 73