How to add/update user data to LDAP Active Directory located on another server using PowerShell script?

后端 未结 1 1430
[愿得一人]
[愿得一人] 2021-01-29 05:36

I want to add/update data of Active Directory located on another server. I have server details but I don\'t know how to do it. However, I know how to add/update data if I run Po

相关标签:
1条回答
  • 2021-01-29 06:26

    You need to include the -Server <string> parameter for connecting to another server before creating / validating the user.

    Also, I think you meant -Filter as the parameter with Get-ADUser cmdlet, and not -F.

    -Server

    Specifies the Active Directory Domain Services instance to connect to, by providing one of the following values for a corresponding domain name or directory server. The service may be any of the following: Active Directory Lightweight Domain Services, Active Directory Domain Services or Active Directory Snapshot instance. ...

    Get-ADUser -Filter {SamAccountName -eq $Username} -Server a.b.c.d ...
    # reference from https://docs.microsoft.com/en-us/powershell/module/addsadministration/get-aduser?view=win10-ps
    
    New-ADUser ... -Server a.b.c.d ... 
    # reference from https://technet.microsoft.com/fr-fr/library/hh852238(v=wps.630).aspx
    
    0 讨论(0)
提交回复
热议问题