Answer the question
In order to leave comments, you need to log in
How to export specific users from a domain using Powershell?
Good afternoon guys!
There was such task, to export users from software UserGate. Find them in the local domain by last name, export and transfer to another domain.
Using python, I parsed the xml file usergate. Got surnames, now you need to find these surnames in the domain and import them into cvs. Unfortunately, I don't know powershell at all. That's why I'm asking for a little advice.
$DB = cat .\user.txt
foreach ($i in $DB)
{
$Users = Get-ADUser -Filter {Surname -eq $i} -Properties *
}
Answer the question
In order to leave comments, you need to log in
$DB = cat .\user.txt
foreach ($i in $DB)
{
Get-ADUser -Filter {Surname -eq $i} -Properties * | export-csv c:\test\csvfile.csv -append -notypeinformation
}
works?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question