The first script is still returning the same wrong format. Regarding the last script that would not be an option as going forward, there will be several old domains to match with the new one.
$sourceuser and $destination users are in two variables in the following format:
… and what exactly would be the issue with that? Do you have more than one new domain? If that’s the case it might be easier to provide the input data in another format … like CSV for example where you have exact relations between the old account and the new account.
Edit: to use 2 actually unrelated arrays as input might be error prone.
Right - the idea is to export the file in CSV and then manipulate it going forward. So far I have that two variables that I want to merge in one CSV file and continue the script.
Unfortunately, the output is now empty. I think could be easier to manipulate the part where I obtained the two different output so that we can have sourceuser and destinationuser in one format altogether.
#query for source users
$csvdata = Import-CSV -path $csvFile | Select-Object id
The resulting two arrays are actually completely unrealted. How do you match an account from an old domain to an account in a new domain?
Edit: I noticed just now … even worse: you create your $csvdata by selecting the property “id” but you use it later with the property “muid”. That cannot work actually at all!?
The resulting two arrays are actually completely unrealted. How do you match an account from an old domain to an account in a new domain?
Edit: I noticed just now … even worse: you create your $csvdata by selecting the property “id” but you use it later with the property “muid“. That cannot work actually at all!?
[/quote]
Hi Olaf,
The script is working until giving the result “$sourcedestinatinuser” but I understand that logic is not giving the best effect. For this reason, I am trying to make changes and improve it based on your recommendations.
As far as I could see, one of the suggestions you gave me did work after a few tests, but I needed to delete something and keep it like that: