This topic contains 3 replies, has 3 voices, and was last updated by
March 19, 2018 at 6:09 pm #96416ParticipantTopics: 3Replies: 2Points: 1Rank: Member
Looking for a way to compare a computer account list in an 'OnPrem' AD and an 'AzureAD' list and list out the differences.
Basically I need something that will allow me to tell which computer accounts on are on the AzureAD list and not on the 'OnPrem' AD list.
I've done some digging on it and the answer I came up with was useless (Dump both lists to a CSV file and run a compare off of that) as the difference listed all had a trailing $ character on them from AzureAD.
Any help would be appreciated.
March 20, 2018 at 2:32 am #96461ParticipantTopics: 2Replies: 963Points: 1,756Rank: Community Hero
You are correct that you have to dump a list, but it does not have to written to the drive as a CSV.
Just dump the list to two different variables, then use the Compare-Object to compare the data in the two variables.
You can do this dynamically vs files, unless for whatever reason, you need to right the final output to a file.
March 20, 2018 at 1:50 pm #96528ParticipantTopics: 3Replies: 2Points: 1Rank: Member
Here is my problem is the output for dumping the AzureAD list
I dump OnPrem AD Computer Acccount List
I dump Azure AD Device list
I compare the 2
The AzureAD list has a trailing $ on the exact same computer accounts
ex: Computer1 on OnPremAD and Computer1$ on AzureAD which triggers it as being a "different" machine however in reality it is the same machine.
Does that make sense?
March 20, 2018 at 3:44 pm #96540ParticipantTopics: 1Replies: 1358Points: 1,813Rank: Community Hero
Do you use the same code for both sides to get the information? The SamAccountName of a computer in AD has a trailing '$'. You might compare the name from one side with the SamAccountName from the other side.
The topic ‘Script ideas/request - Compare On Prem AD / Azure AD’ is closed to new replies.