Anthony K O365
asked on
Add users from one Domain to Security Group in different Domain
I have a csv file of users from Domain B and would like to add them to a SG in Domain A. Please share the PowerShell command that would accomplish this.
thank you
thank you
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Here is my script: My csv has column of SamAccountName
Import-module ActiveDirectory
$Users = IpCSV "C:\Users2.csv"
$Group = [ADSI]"LDAP://[ADSI]"LDAP: //cn=Test Group,ou=West,dc=MyDomain, dc=com"
$Users | %{Add-ADPrincipalGroupMemb ership -identity $_.samAccountName -server myDomain.com -MemberOf $Group
}
I still error 'can't find object
Import-module ActiveDirectory
$Users = IpCSV "C:\Users2.csv"
$Group = [ADSI]"LDAP://[ADSI]"LDAP:
$Users | %{Add-ADPrincipalGroupMemb
}
I still error 'can't find object
ASKER
This will probably work, I just need to know how to use the csv file of users from DomainBBB
$DomainBBBUser = Get-ADUser Test1 -Server $DomainBBB
Add-ADGroupMember Administrators -Members $DomainBBBUser
$DomainAAAGroup = Get-ADGroup Administrators
Add-ADPrincipalGroupMember ship -Server $DomainBBB Test1 -MemberOf $DomanAAAGroup
$DomainBBBUser = Get-ADUser Test1 -Server $DomainBBB
Add-ADGroupMember Administrators -Members $DomainBBBUser
$DomainAAAGroup = Get-ADGroup Administrators
Add-ADPrincipalGroupMember
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Richard,
This in fact was done. Thank you!
This in fact was done. Thank you!
ASKER
closing
ASKER